- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 锁住listview防止刷新
//更新数据
//锁住listview防止刷新
LockWindowUpdate(Self.ListView1.Handle);
ListView1.Items.BeginUpdate;
try
with ListView1 do
begin
for i := 0 to Items.Count - 1 do
begin
Items.Item[i].SubItems.Strings[2] := CurrPx;
Items.Item[i].SubItems.Strings[3] := ChangeRate;
Items.Item[i].SubItems.Strings[5] := chosenTime;
end;
end;
finally
ListView1.Items.EndUpdate;
//解锁listview
LockWindowUpdate(0);
end;
//增加数据
with listview1.items.add do
begin
subitems.add(Stockid);
subitems.add(StockName);
subitems.add(CurrPx);
subitems.add(ChangeRate);
subItems.Add(Ajson.ItemByName('changeRate').AsString);
subitems.add(chosenTime);
end;