procedure TForm1.ListBox1Click(Sender: TObject);
var ListBoxItem:TRect;
begin
ListBoxItem:=ListBox1.ItemRect(ListBox1.ItemIndex);
Label1.Caption:='Слева '+ IntToStr(ListBoxItem.Left);
Label2.Caption:='Сверху '+ IntToStr(ListBoxItem.Top);
Label3.Caption:='Справа '+ IntToStr(ListBoxItem.Right);
Label4.Caption:='Снизу '+ IntToStr(ListBoxItem.Bottom);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with ListBox1 do
begin
items.add('Привет') ;
items.add('мы вместе') ;
items.add('до свидания') ;
end;
procedure TForm1.addClick(Sender: TObject);
begin
ListBox1.Items.Add(Edit1.Text);
end;
procedure TForm1.SortClick(Sender: TObject);
begin
ListBox1.Sorted:=True;
end;