有listbox1,listbox2,table1,table2
listbox1显示table1记录,table2为空,现在我想从listbox1中选取几条记录到listbox2中并插入到table 中,如何做?
listbox1显示table1记录,table2为空,现在我想从listbox1中选取几条记录到listbox2中并插入到table 中,如何做?
解决方案 »
- 怎样动态调入DLL窗体和怎样把SocketConnection1联接等对像送到DLL窗体中去?
- 请问一下这个函数在哪个DLL中有啊?
- 哪有DELPHI的中文帮助手册啊!
- 百分请教::Active控件问题,在线等,控件只有在降低IE安全行后才能下载????????
- “Operation must be performed on the current session.”是什么意思啊?它还是出现了这个提示错误!
- 我把ADOQUERY 中数据读到CHECKLISTBOX中怎么出错呢?
- 怎么求字符的ASCII码
- 一个急待解决的问题!谢谢各位。
- 关于SQLSERVER的问题××××××××××
- 在orical数据库中如何用delphi存储jpg图象!!jpg图象是文件的形式!!!急!!!!!!
- 如何检测输入的是中文????
- 控件问题????
参考下
procedure Tfrm_cx.tolClick(Sender: TObject);
var
i,cz:integer;itemstr:string;
begin
if lb1.itemindex>-1 then
begin
cz:=0;
itemstr:=lb1.Items.Strings[lb1.itemindex];
for i:=0 to lb2.Items.Count-1 do
begin
if lb2.Items.strings[i]=itemstr then
begin
cz:=1;
break;
end
end;
if cz=0 then
begin
lb2.items.add(itemstr);
button1.enabled:=true;
qysave.enabled:=true;
table2.append;
table2.FindField('字段名').asstring:=itemstr ;
end
else
application.MessageBox('您所选择的字段已存在输出列表中,请不要重复。','错误',16);
end
else
showmessage('请选择要输出的字段.');
end;
for I:=0 to listbox1.Count-1 do
begin
if listbox1.Selected[i] then
listbox2.Items.Add(listbox1.Items[i]);
end;
插入空表就不写了不就是从listbox2 中循环插入一遍嘛