col*_*lin 9 delphi tstringgrid
我正在从CSV文件@ runtime中向字符串网格添加多行,但是当StringGrid被提升时似乎闪烁很多,我假设会有一个beginupadate/Endupdate命令来阻止它.但是我找不到它.是否有另一种方法可以在更新网格ID时停止闪烁.
科林
rou*_*men 17
迟到总比没好...我用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;
...
Run Code Online (Sandbox Code Playgroud)
这些是“TStrings”对象的方法。使用 StringGrid1.Rows[i]/Cols[i].BeginUpdate; ... StringGrid1.Rows[i]/Cols[i].EndUpdate;
你尝试过设置DoubleBuffered := true吗?