条目是连续的导入没问题,要是选择的不是连续的就不对了(选择的是前几个(选择三个就是前三条)),谁能帮我改一改呢?代码如下
procedure Tf_main.sB_swyy2Click(Sender: TObject);
var
Iitemno,Ino,i: Integer;
ifsame:boolean;
begin
Iitemno:=0;
with sLB_swyyqb do
for Ino:=0 to Items.Count-1 do
begin
if Selected[Ino] then
begin
Iitemno:=Ino;
Break;
end;
end; ifsame:=false;
with sLB_swyyqb do
begin
for Ino:=Iitemno to Iitemno+(sLB_swyyqb.SelCount-1) do
begin
for i:=0 to sLB_swyyxz.Items.Count-1 do
begin
if Items[Ino]= sLB_swyyxz.Items[i] then
begin
ifsame:=true;
break;
end;
ifsame:=false;
end;
if ifsame=false then sLB_swyyxz.Items.Add(Items[Ino]);
end;
end;
end;
procedure Tf_main.sB_swyy2Click(Sender: TObject);
var
Iitemno,Ino,i: Integer;
ifsame:boolean;
begin
Iitemno:=0;
with sLB_swyyqb do
for Ino:=0 to Items.Count-1 do
begin
if Selected[Ino] then
begin
Iitemno:=Ino;
Break;
end;
end; ifsame:=false;
with sLB_swyyqb do
begin
for Ino:=Iitemno to Iitemno+(sLB_swyyqb.SelCount-1) do
begin
for i:=0 to sLB_swyyxz.Items.Count-1 do
begin
if Items[Ino]= sLB_swyyxz.Items[i] then
begin
ifsame:=true;
break;
end;
ifsame:=false;
end;
if ifsame=false then sLB_swyyxz.Items.Add(Items[Ino]);
end;
end;
end;
解决方案 »
- Delphi的WideString类型转换
- 求教:用DELPHI實現 把數據庫中為正數的值在DataGrid中顯示為負值
- delphi6如何调用BCB6的obj文件?
- Delphi对数据库访问时如何对图形字段进行插入、修改,用Sql来实现。
- access连接问题~
- 请教SQL!
- 急死了,为什么组件条上的QReport,FastNet组件条不见了
- 各位高手快来指点一下,是关于动态创建组件的!
- d7+sql2000 局域网掉线重连的问题
- 共同探讨软件加密的问题(经典的给分哟)
- *** 高分请问一个比较难的问题,关于Delphi6和nvarchar的 ***
- 请教各派高手一个问题,DELPHI三层技术,怎么调用中间层,用TDCOMConnection起连接时Connected连不上,severname里面没东西啊
var
i: integer;
begin
for i:=0 to ListBox1.Count -1 do
begin
if ListBox1.Selected[i] then
begin
if ListBox2.Items.IndexOf(ListBox1.Items.Strings[i])<0 then
ListBox2.Items.Add(ListBox1.Items.Strings[i]);
end;
end;
end;