我正在运行时从 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/