Sunday, 1 September 2013

Select one string line in a list

Select one string line in a list

I'm trying to simply select one string line out a long list strings that
are held on a server and seperated with a pipe character. This string is
grabbed by a php script and the string line is a list of all the media and
folders I have on my server.
In my code I'm getting this information and returning it with the
following code:
using (var client = new WebClient())
{
result =
client.DownloadString("http://bender.holovis.com/images/getDirectoryList.php");
}
textBox1.Text = string.Join(Environment.NewLine, result.Split('|'));
And it looks like this:

But when I try to simply click on one of them, my cursor simply just goes
to where I've clicked. Like this, I tried to select md-harrier.jpg and my
cursor just ends up at the end of jpg:

What I'm really wanting is pictured below. I click on Koala.jpg and the
whole thing is highlighted and I have the ability to store the name of
what it is I've just clicked on. TO achieve that screen shot I had to
click next to Koala.jpg and then drag my mouse along.

Is there anyway I can achieve what I want to achieve?
The key thing to note about this is that I will have no idea how many
files will be on the server, nor what they will be called. My php script
is grabbing this information and displaying it in my winform text box
using the code I have wrote above.

No comments:

Post a Comment