Delphi TStringGrid 闪烁 [英] Delphi TStringGrid Flicker

查看:18
本文介绍了Delphi TStringGrid 闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 CSV 文件 @ 运行时向字符串网格添加多行,但是 StringGrid 在更新时似乎闪烁很多,我认为会有一个 beginupadate/Endupdate 命令来阻止这个.但是我找不到它.是否有另一种方法可以在更新网格 ID 时停止闪烁.

I am adding multiple rows to a string grid from a CSV file @ runtime, However the StringGrid seems to flicker lots when it is being upadated, I presumed there would be a beginupadate / Endupdate command to stop this. However I cannot find it. Is there another way to stop the flicker when the grid id being updated.

科林

推荐答案

迟到总比不到好...我使用 WM_SETREDRAW.例如:

Better late than never... I use WM_SETREDRAW. For example:

...
StringGrid1.Perform(WM_SETREDRAW, 0, 0);
try
  // StringGrid1 is populated with the data here 
finally
  StringGrid1.Perform(WM_SETREDRAW, 1, 0);
  StringGrid1.Invalidate; // important! to force repaint after all
end;
...

这篇关于Delphi TStringGrid 闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆