procedure TForm1.ListBox1Click(Sender: TObject); var i:integer; begin for i:=0 to (Sender as TListBox ).Count-1 do begin if ListBox1.Selected[i] then Edit1.Text:=(Sender as TListBox ).Items[i]; end;end;
Edit1.Text:=ListBox1.Items[ListBox1.ItemIndex];
换个更简单的 procedure TForm1.ListBox1Click(Sender: TObject); Edit1.Text:=(Sender as TListBox ).Items[(Sender as TListBox ).itemindex]; 或者Edit1.Text:=ListBox1.Items[ListBox1.itemindex] end;
var
i:integer;
begin
for i:=0 to (Sender as TListBox ).Count-1 do
begin
if ListBox1.Selected[i] then
Edit1.Text:=(Sender as TListBox ).Items[i];
end;end;
procedure TForm1.ListBox1Click(Sender: TObject); Edit1.Text:=(Sender as TListBox ).Items[(Sender as TListBox ).itemindex];
或者Edit1.Text:=ListBox1.Items[ListBox1.itemindex]
end;
edit1.text:=listbox1.items.text//listbox中的所有内容