pegando itens do listbox

Delphi

05/04/2004

oi galera,eu estou usando um liststbox no meu form e no listbox ha varios itens,eu queria que quando eu clicasse duas vezes em um desses itens o meu LABEL1 recebece o ´lstbox1.itens.text´ desse listbox,como e que eu faço isso ?


Anicetojunior

Anicetojunior

Curtidas 0

Respostas

Marcio.theis

Marcio.theis

05/04/2004

lbl.Caption:=ListBox.Items[ListBox.ItemIndex];


GOSTEI 0
Mpetranela

Mpetranela

05/04/2004

Ou tb:

procedure .....

var i: integer;
begin
if ListView.SelCount = 1 then
begin
for i := 0 to ListView.Items.Count do
if ListView.Items[i].Selected then
begin
lbl.caption := ListView.Items[i].Caption;
break;
end;
end;
end;


GOSTEI 0
POSTAR