Board index » cppbuilder » Are there any items in: CheckListBox1->Items ??

Are there any items in: CheckListBox1->Items ??

  How can the application knows if there are any items in:
CheckListBox1->Items  ??

  The below one is not right...

  for (int i = 0;  i  < CheckListBox1->Items->Count;  i++)
  {
       if(CheckListBox1->Items->Strings[i] == "")
      {
           ShowMessage ("No Items in me......!");
      }
  }

  Any idea...?

  Oren.

 

Re:Are there any items in: CheckListBox1->Items ??


Quote
Oren wrote:
>   How can the application knows if there are any items in:
> CheckListBox1->Items  ??

The count property tells you how many items there are:
   if(!CheckListBox1->Items->Count)
      ShowMessage("No items here!");

Adam.

Other Threads