Delphi TStringGrid 闪烁

标签 delphi tstringgrid

我正在运行时从 CSV 文件向字符串网格添加多行,但是 StringGrid 在更新时似乎会闪烁很多,我认为会有一个 beginupadate/Endupdate 命令来停止此操作。但是我找不到它。有没有其他方法可以在更新网格 ID 时停止闪烁。

科林

最佳答案

迟到总比不到好…… 我用WM_SETREDRAW 。例如:

...
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 闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3712229/

相关文章:

delphi - TriticalSection TryEnter 方法始终返回 True

delphi - 拖动时将鼠标悬停在字符串网格上?

delphi - 如何删除 TStringGrid 行?

delphi - TTimer.OnTimer 事件处理程序是可重入的吗?

arrays - 两条记录共享相同的值?

objective-c - firemonkey + xcode,混合代码

android - 如何阻止 IDE 在我的非 Windows 项目中引用特定于 Windows 的 XML 单元?

delphi - 开始输入stringgrid的选定单元格

delphi - TStringGrid - 有没有一种简单的方法来获取 "current/selected"行?

delphi - 在 Delphi XE2 中使用样式的字符串网格 - 滚动条不更新