I am trying to make a ListView dynamically.
i patterned my code to what is given in the help file
however when i execute the code, nothing is displayed
on the form (blank form)
what could be missing in my code... please help.
Code:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TListItem *pListItem;
TListColumn *pNewColumn;
TListView *pListView;
const char Names[6][2][10] =
{{"Rubble","Barny"},
{"Michael", "Johnson"},
{"Bunny", "Bugs"},
{"Silver", "HiHo"},
{"Simpson", "Bart"},
{"Squirrel", "Rocky"}};
TListView *pListView = new TListView(this);
pListView->Parent = this;
pListView->Align = alClient;
pListView->ViewStyle = vsReport;
pNewColumn = pListView->Columns->Add();
pNewColumn->Caption = "Last";
pNewColumn = pListView->Columns->Add();
pNewColumn->Caption = "First";
for (int i = 0; i < 6; i++)
{
pListItem = pListView->Items->Add();
pListItem->Caption = Names[i][0];
pListItem->SubItems->Add(Names[i][1]);
}