Board index » cppbuilder » Re: How to check if *ALL* ListBox->items are selected...?

Re: How to check if *ALL* ListBox->items are selected...?


2005-09-02 08:33:52 PM
cppbuilder92
"Oren Halvani" < XXXX@XXXXX.COM >wrote in message
Quote
what should i modify if i want to know if all Items of ListBox are
selected
but *WITHOUT* using an additional for loop...?
Why don't you want to use a for loop ?
It would be really simple:
bool IsAllSelected = true;
for( int i = 0; i < FileBox->Items->Count; ++i )
{
if( !FileBox->Selected[i] )
{
IsAllSelected = false;
break;
}
}
Now use IsAllSelected to check whether all the items are selected.
Jonathan
 
 

Re:Re: How to check if *ALL* ListBox->items are selected...?

dear builders,
what should i modify if i want to know if all Items of ListBox are selected
but *WITHOUT* using an additional for loop...?
/*
// FileBox = ListBox....
int items = FileBox->Items->Count;
for(int i = items - 1; i>= 0; --i)
{
if(FileBox->Selected[i]) FileBox->Items->Delete(i);
if(FileBox->Items->Count == 0)
{
//....
}
//else if(FileBox->Items->Count == 1) FileShow(FileBox->Items->Strings[0]);
//if(FileBox->Items->Count != 0 && FileBox->Items->Count != 1) { FileShow(FileBox->Items->Strings[FileBox->Items->Count -
1]); }
SaveRegFiles();
}
*/
Oren
 

Re:Re: How to check if *ALL* ListBox->items are selected...?

Thanks Jonathan !
thats it :-)
Oren
 

{smallsort}