有listbox3 和listbox4 两个列表框,我要把list3 中符合条件的行添加到list4中,
但是在添加过程中由于要多次遍历list3,所以list3会闪动,有没有办法在遍历时不
让list3闪动(系统不重画list3),而是在添加工作完成后再重画list3?
procedure TfOpreSet.DBLookupComboBox2CloseUp(Sender: TObject);
var T_Gauth,T_sub,itemtext:string;
li_len,li_i:smallint;
procedure selectinte(lb:Tlistbox;des:string);
var li:smallint;
begin
for li := 0 to lb.Count -1 do
begin
lb.ItemIndex := li;
lb.Selected[li]:=true;
if rightstr(lb.Items[lb.ItemIndex],3) = des then
break;
end;
end;
begin
listbox4.Clear;
with fdm.Q3 do
begin
T_Gauth:=fieldbyname('GAuthrity').asstring;
li_len:=Length(T_Gauth);
li_i:=1;
while Length(T_Gauth) > 1 do
begin
T_sub:=copy(T_Gauth,1,3);
T_Gauth:=RightStr(T_Gauth,li_len - (li_i * 3));
inc(li_i);
selectinte(listbox3,T_sub);
itemtext:=ListBox3.Items[ListBox3.ItemIndex];
if not InListBox(listbox4,itemtext) then
listbox4.Items.Add(itemtext);
end;
end;
end;