Board index » cppbuilder » Getting item names from a TListBox with multiselect true

Getting item names from a TListBox with multiselect true


2005-05-02 04:29:54 AM
cppbuilder55
I have a FileListBox and I want to get the names of the files that are
selected. I want to be able to select up to two items at once and then
retrieve their names? I have multiselect to true, but I don't know how
to go about accessing the filenames? Obviously FileListBox1->FileName
won't work for two?
regards,
Rory.
 
 

Re:Getting item names from a TListBox with multiselect true

Rory Walsh wrote:
Quote
... a FileListBox and I want to get the names of the files that are
selected.
See the example in the help for the Items property:
FileListBox1->Items->Strings[....];
Hans.
 

Re:Getting item names from a TListBox with multiselect true

"Rory Walsh" < XXXX@XXXXX.COM >wrote in message
Quote
I have a FileListBox and I want to get the names of the files that are
selected. I want to be able to select up to two items at once and then
retrieve their names?
for(int x = 0; x < FileListBox1->Items->Count; ++x)
{
if( FileListBox1->Selected[x] )
{
// use FileListBox1->Items->Strings[x] as needed...
}
}
Gambit
 

{smallsort}

Re:Getting item names from a TListBox with multiselect true

Hi all,
I tried to use a TStringList to seperate a sentance, but I want to use a
specific character, instead of the preset space, comma or other. Since I'm
seperating normal sentaces, theses characters are commonly used in the
sentaces, instead, I'd like to use like '@' as a delimiter character. I tried
setting '@' as the Delimiter in the TStringList and load the sentaces with
DelimitedText. Still, the TStringList insisted to seperate my texts using
spaces, commas and semicolons. Is there a way to tell TStringList to ignore
space, comma and semicolon (actually, semicolon is okay, since it is not likely
I'll have it in any of the target text I'm processing, so I really need the
TStringList to ignore space and comma only.)
i.e:(please view with fixed width font)
The phrase "I am not going; to do that!" and I'd like it to be seperated into:
^
delimiter
"I am not going"
" to do that!"
instead of:
"I"
"am"
"not"
"going"
"to"
"do"
"that!"
(for anyone ever curious why I'm doing that, the answer is due to screen space
constrain)
Thanks In Advance.
Regards.
--
-------------------------------------------------------------
"Aaaaah yourself!.....Uh, oh-o!"
-Serious 'Second Encounter' Sam-
-------------------------------------------------------------
 

Re:Getting item names from a TListBox with multiselect true

ChoyKw wrote:
<snipped>
Sorry that I misposted this, please ignore this post and the upperlevel post
and answer to the other root post instead. Sorry.
--
-------------------------------------------------------------
"Aaaaah yourself!.....Uh, oh-o!"
-Serious 'Second Encounter' Sam-
-------------------------------------------------------------