delphi – 刷新,更新和重绘有什么区别?

前端之家收集整理的这篇文章主要介绍了delphi – 刷新,更新和重绘有什么区别?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我不知道这三种方法中哪一种最适合我。他们都为我工作。有谁知道刷新,更新和重绘之间的区别?

解决方法

根据在线文档。

Refresh – 在屏幕上重绘控制。

Call Refresh method to repaint the
control immediately. Refresh calls the
Repaint method. Use the Refresh and
Repaint methods interchangeably.

Repaint – 强制控件在屏幕上重绘其图像。

Call Repaint to force the control to
repaint its image immediately. If the
ControlStyle property includes
csOpaque,the control paints itself
directly. Otherwise,the Repaint
method calls the Invalidate method and
then the Update method so that any
visible portions of controls beneath
the control will be repainted as well.

Update – 立即处理任何待处理的绘制消息。

Call Update to force the control to be
repainted before any more,possibly
time-consuming,processing takes
place. Use Update to provide immediate
Feedback to the user that cannot wait
for the Windows paint message to
arrive.

Update does not invalidate the control,but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead to invalidate the control as well.

原文链接:https://www.f2er.com/delphi/103755.html

猜你在找的Delphi相关文章