LITHIA
Nov 25th, 2006, 11:33 AM
Hi everyone.
I have a ListView with lots of items in it that represent files. Their Text properties are the actual filenames for the file that the item represents.
Now, I have allowed the user to edit the name of the file by using the BeginEdit() method. The only problem I have is actually specifying what the part of the text should be selected in the label when it starts to be edited. I would have liked it so that only the name of the file without the extension is selected when I use BeginEdit(), but I have not found anywhere (and I have searched) about specifying what should be selected.
It would be a very easy case of using the LastIndexOf of the text to specify where the text should be selected up to, but I can't find a method/property to just simply specify what part of the label to be selected. At the moment, the entire thing is selected whenever the BeginEdit() is started.
I'm wondering if it can actually be done. I really don't want to have to resort to having to rename the file in order to exploit what is selected. In fact, I see absolutely no methods in which to alter the label that edits it at all.
Thanks very much! I'm rather stuck at this point.
I have a ListView with lots of items in it that represent files. Their Text properties are the actual filenames for the file that the item represents.
Now, I have allowed the user to edit the name of the file by using the BeginEdit() method. The only problem I have is actually specifying what the part of the text should be selected in the label when it starts to be edited. I would have liked it so that only the name of the file without the extension is selected when I use BeginEdit(), but I have not found anywhere (and I have searched) about specifying what should be selected.
It would be a very easy case of using the LastIndexOf of the text to specify where the text should be selected up to, but I can't find a method/property to just simply specify what part of the label to be selected. At the moment, the entire thing is selected whenever the BeginEdit() is started.
I'm wondering if it can actually be done. I really don't want to have to resort to having to rename the file in order to exploit what is selected. In fact, I see absolutely no methods in which to alter the label that edits it at all.
Thanks very much! I'm rather stuck at this point.