Troche nasciemniałem :)
ja kozystam z C++ Builder 6
A wiec:
1) na formatke 2 TBUtton, 1 TMemo, 1 ListView (dodaj 4 kolumny)
i umiesc nastepujacy kod :)
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TListItem *item;
ListView1->Items->BeginUpdate();
ListView1->Clear();
for(int i=1;i<10;i++)
{
item=ListView1->Items->Add();
item->Caption="Zamiykanie";
item->SubItems->Add("Exit");
item->SubItems->Add("Zamykanie programu");
item->SubItems->Add(i);
}
ListView1->Items->EndUpdate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
AnsiString tekst;
tekst=ListView1->Items->Item[0]->Caption + " " + ListView1->Items->Item[0]->SubItems->Text; // + " " + ListView1->Items->Item[0]->SubItems->Text + " " + ListView1->Items->Item[0]->SubItems->Text);
Memo1->Lines->Text=tekst;
}
//---------------------------------------------------------------------------