/*
ItemIndex, Move example
This example uses a list box and a button on a form. The list box contains items when the form appears. When the user clicks the button, the selected item in the list box is moved to the top of the list box:
*/ 
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  ListBox1->MultiSelect = false;
  Button1->Caption = "Move to Top";
  for (int i = 1; i <= 10; i++)
    ListBox1->Items->Add("Item " + IntToStr(i));
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  ListBox1->Items->Move(ListBox1->ItemIndex, 0);
}
 
