娃 娃娃 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #3 为个很简单啊,做一个遍历 for i:=0 to listbox1.items.count-1do begin if listbox1.selected then memo1.lines.add(listbox.items.string); end;
为个很简单啊,做一个遍历 for i:=0 to listbox1.items.count-1do begin if listbox1.selected then memo1.lines.add(listbox.items.string); end;
X xieyj Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #4 我指的是 SelCount ,选取的ITEM,而不是所有的
吴 吴明桓 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #5 procedure TForm1.ListBox1Click(Sender: TObject); var s:string; begin s:=listbox1.Items[listbox1.itemindex]; showmessage(s); end;
procedure TForm1.ListBox1Click(Sender: TObject); var s:string; begin s:=listbox1.Items[listbox1.itemindex]; showmessage(s); end;
X xieyj Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #6 楼上的兄弟,谢谢您,这是选取一个时可以这样写,选取多个应该怎么写呢?
王 王公子 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #7 for I := List.Items.Count - 1do wnto 0do if List.Selected then begin Items.AddObject(List.Items, List.Items.Objects); List.Items.Delete(I); end; DELPHI有个自带的模板呀
for I := List.Items.Count - 1do wnto 0do if List.Selected then begin Items.AddObject(List.Items, List.Items.Objects); List.Items.Delete(I); end; DELPHI有个自带的模板呀
X xieyj Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #8 大家都不明白我的意思,是 Listbox.SelCount ,而不是 Listbox.items.count 是选择的项目
娃 娃娃 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-02 #9 你先试试我的代码先。不管是多选还是单选,只要被先中的,那一行的 selected属性就是真,所以,只要做一个遍历就行了。
老 老人家 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-04 #10 procedure TForm1.Button1Click(Sender: TObject); begin Listbox1.MoveSelection(TCustomListControl(Listbox2)); end;
procedure TForm1.Button1Click(Sender: TObject); begin Listbox1.MoveSelection(TCustomListControl(Listbox2)); end;
C chenzhou Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-16 #13 to 娃娃 你的代码肯定可以 不用试 但是太慢
若 若凡 Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-16 #14 你试一试吧! var i:integer; begin for i:=0 to listbox1.Items.Count-1do begin if listbox1.Selected then memo1.Lines.Add(listbox1.Items); end; end;
你试一试吧! var i:integer; begin for i:=0 to listbox1.Items.Count-1do begin if listbox1.Selected then memo1.Lines.Add(listbox1.Items); end; end;