Delphi TStringGrid闪烁 [英] Delphi TStringGrid Flicker

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

问题描述

我从CSV文件@运行时向字符串网格添加了多行,但是当它被越来越多的时候,StringGrid似乎闪烁了很多,我推测会有一个beginupadate / Endupdate命令来阻止它。但是我找不到它。当更新网格ID时,是否有另一种方法来停止闪烁。



Colin

解决方案

$ b我使用 WM_SETREDRAW 。例如:

  ... 
StringGrid1.Perform(WM_SETREDRAW,0,0);
try
// StringGrid1用这里的数据填充
finally
StringGrid1.Perform(WM_SETREDRAW,1,0);
StringGrid1.Invalidate; //重要!所有
结束后强制重绘;
...


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.

Colin

解决方案

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天全站免登陆