在ListBox1中的内容按住Shift或Ctrl键,选择多个ListBox1中的内容,再添加到ListBox2中。
请教,怎么实现?
请教,怎么实现?
解决方案 »
- 关于DELPHI调用C++写的DLL问题(120分)
- 请问如何检测是否按下键盘或鼠标,如果超过5分钟没有操作则认为用户已经离开?
- 征求一个方案,关于远程数据库记录更新的问题?详细请进.
- 对WINDOWS资源管理器中的文件、文件夹加密,有没这样的API?
- Midas与Com+问题?
- 关于一个(考勤)算法的问题,有代码
- 急问用table1.batchMove(Asource:TBDEDateSet;AMode:TBatchMode):longint移动数据时提示destination must be indexed.table.我建索引后还
- CSDN的保存问题
- 小小虾请教一个很笨的问题
- 一个问题,建立的 FB: TBevel没显示,好象根本没建立一样。
- 两个简单小问题
- 关于文件读写,很菜的问题,各位帮帮我
for i := 0 to ListBox1.Items.Count-1 do
if ListBox1.Selected[i] then ListBox2.Items.Add(ListBox1.Items[i]);
listbox中有个属性:multiselect,将它设置为true,就可以多选了
至于添加unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
I:word;begin
I:=0;
for I:=0 to listbox1.Itemindex do
if listbox1.Selected[i] then
begin
listbox2.Items.Add(listbox1.Items.Strings[i]); end;
end;end.
(2)var
i: integer;
begin
for i := 0 to ListBox1.Items.Count-1 do
if ListBox1.Selected[i] then
ListBox2.Items.Add(ListBox1.Items[i]);
end;
http://community.csdn.net/Expert/topic/3591/3591531.xml?temp=.6054193;
http://community.csdn.net/Expert/topic/3590/3590004.xml?temp=3.788394E-02;
http://community.csdn.net/Expert/topic/3588/3588621.xml?temp=.8432581
呵呵~~~!!!
不是啊!
献丑了!本人脑袋不是很灵啊!献丑。献丑。献丑、
我好像试过啊!MultiSelect := True;但是按住Shift或Ctrl都不行啊!
顺便再帮我个忙:
Project ConsumeApp.exe raise exeception class EOleException with message 'ERROR:parser error at or near "form"'.process stopped;
到底是哪里出问题了?
-----------------------------------------------------------------------------------------
MultiSelect := True 是一定可以的