I have a checkedListBox1 wich consist of a many lines with text.
What I am trying to do is to search trough this checkedListBox1 to see
if "Hello" could be found in this box and if it is found, this Item(Line) will
be selected.
I am not sure what could be wrong/missing with this code. ?

for( int i = 0; i < checkedListBox1->Text->Length; i++)
{
	
      if(checkedListBox1->Text->IndexOf(i).ToString() == "Hello")
     {
	checkedListBox1->Select();
     }

}

> for( int i = 0; i < checkedListBox1->Text->Length; i++)
Edward doesn't understand how this is supposed to search the items. The Text property gives you the text of the currently selected item. Ed would expect something more like this:

for (int i = 0; i < checkedListBox1->Items->Count; ++i) {
  Object^ item = checkedListBox1->Items[i];

  if (checkedListBox1->GetItemText(item) == "Hello") {
    checkedListBox->SelectedIndex = i;

    // Found a match, so we're done
    break;
  }
}

Thank you. Yes it was ofcourse Items->Count;
This worked fine.

> for( int i = 0; i < checkedListBox1->Text->Length; i++)
Edward doesn't understand how this is supposed to search the items. The Text property gives you the text of the currently selected item. Ed would expect something more like this:

for (int i = 0; i < checkedListBox1->Items->Count; ++i) {
  Object^ item = checkedListBox1->Items[i];

  if (checkedListBox1->GetItemText(item) == "Hello") {
    checkedListBox->SelectedIndex = i;

    // Found a match, so we're done
    break;
  }
}
This question has already been answered. Start a new discussion instead.