我从CSV文件@ runtime向字符串网格添加了多行,但是StringGrid在更新时似乎闪烁了很多,我推测会有一个beginupadate / Endupdate命令来停止它。但是我找不到它。有没有其他方法可以在更新网格id时停止闪烁。
科林
发布于 2011-08-18 05:50:29
迟到总比不到好。我使用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;
...发布于 2010-09-15 13:54:37
是的,TStringgrid中没有BeginUpdate/EndUpdate,但每行或每列都有:
StringGrid1.Rows[0].BeginUpdate;
StringGrid1.Cols[0].BeginUpdate;
发布于 2010-09-15 05:28:55
您可以使用窗口函数LockWindowUpdate(AHandle)来阻止控件的刷新,然后使用LockWindowUpdate(0)来重新绘制它。
作为句柄传递Grid.Handle。
https://stackoverflow.com/questions/3712229
复制相似问题