Default
Google

How can I add items at run-time?

Applies To: C++Builder 1 or higher
Category: Knowledge Base

 
 1.
  Start a new project using File | New Application.
 
 2.
  Add a ListBox.
 
 3.
  Add a Button. Edit its OnClick event:
 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    ListBox1->Items->Add("First");
    ListBox1->Items->Add("Second");
}

C++Builder Developer's Network
Copyright © Yoto Yotov



Acquiring image from ProHosting Banner Exchange