7
Reply

Hyperlinked file array list in windows form application

Jose

Jose

Dec 16 2009 8:12 PM
4.2k
Hello,
I'm new to this forum and I've found some great information here so far!  Great site!

Here's my dilemma...

I have a windows form application which is currently populating a multiline textbox with an array result of files that is found in a specified directory (I can also do it in a richtextbox).  What I want to do with these files is create links to them using something like "file://path/file.txt" (but display only the filename in the visible link) and open in an existing richtextbox. 

I can get files to populate into the richtextbox with no problem, but I'd like to make any files I find in that list linked so that when the user clicks on the file in the result, it will read the contents and display in a larger richtextbox.  I've been searching all over the place and cannot find anyway to do this without creating individual link labels, which cannot be rendered dynamically based on the array result.

As a side note, I'm eventually going to be putting the paths of the text files in an SQL database (which I'm not quite sure yet how I will approach this).  I'm sure this is trivial for a veteran programmer, but I'm a newbie to C# and I'm learning the ropes.  Any help here would be greatly appreciated.

Thanks

Answers (7)