Control.Refresh - does an Control.Invalidate followed by Control.Update. Refresh: 强制控件使其工作区无效并立即重绘自己和任何子控件。==Invalidate Update
Control.Invalidate - invalidates a specific region of the Control (defaults to entire client area) and causes a paint message to be sent to the control.Invalidate marks the control (region, or rect) as in need of repainting, but doesn't immediately repaint (the repaint is triggered when everything else has been taken care of and the app becomes idle). Invalidate: 使控件的特定区域(可以自己设置区域,从而提高性能)无效并向控件发送绘制消息。             将控件标记为需要重绘,但是不会立即执行刷新重绘,等到系统空闲时进行重绘。

Control.Update - causes the Paint event to occur immediately (Windows will normally wait until there are no other messages for the window to process, before raising the Paint event).Update causes the control to immediately repaint if any portions have been invalidated. Update: 使控件重绘其工作区内的无效区域,立即调用Paint事件。若有无效区域,Update将立即触发重绘。
The paint event of course is where all the drawing of your form occurs. Note there is only one pending Paint event, if you call Invalidate 3 times, you will still only receive one Paint event. Paint: 无处不在。如果你调用3次Invalidate,但是系统将只触发一次Paint事件。

Most of the time Invalidate is sufficient, and advisable as you can do a bunch of invalidations (either explicit or implicit) and then let the control repaint itself when the app is idle. It is advisable to use Update or Refresh when you want the control to immediately repaint because the app will not be idle for a user-noticable period of time.

大多数时候Invalidate已经足够了,当系统要集中进行大量的刷新重绘时,建议使用Invalidate,因为这样系统最终只进行一次刷新,提高了系统性能。如果你想立即执行刷新的时候,建议使用Refresh方法。

随机推荐

  1. delphi判断文件类型

    function getFileType(inputFile:string):string;const JPEG_FLAG_BEGIN = $D8FF; JPEG_FLAG_END = $D9FF; ...

  2. HDOJ(2438)几何里的三分

    Turn the corner http://acm.hdu.edu.cn/showproblem.php?pid=2438 题目:一辆车能否在一个路口拐弯,看图就很明白啦. 算法:见下图,只要求出图 ...

  3. Delphi 获取临时数据集 ClientDataSet

    function GetcdsAccountsData: OleVariant; var ASQLQuery: TSQLQuery; Adsp: TProvider; begin ASQLQuery: ...

  4. linux 学习1

    这里主要是听讲的一些东西的总结, thanks to lamp brother ____安装虚拟机 vmware 8.0.4, 因为高版本占用空间大,没必要 cent OS 6.3 linux 版本 ...

  5. .net Session 超时控制

    webconfig里明明设置了timeout是很大的数值了,可是session的有效性仍然无法维持一小时. 查了一下,主要是说 mode="InProc" 的话,session是放 ...

  6. 对于.h文件和.c文件

    C语言中.h文件和.c文件详细解析_云止水_新浪博客http://blog.sina.com.cn/s/blog_73006d600102wcx5.html

  7. 使用oh-my-zsh后导致的卡顿问题

    现象是每次cd和ll时都会被卡住很长时间根本受不了,最后在官方github查明原因是使用的主题会自动获取git信息,可以使用以下命令禁止zsh自动获取git信息,解决卡顿问题 git config - ...

  8. scala 学习之:list span 用法

    Pack consecutive duplicates of list elements into sublists. If a list contains repeated elements the ...

  9. 修改linux文件权限命令:chmod(转)

    Linux系统中的每个文件和目录都有访问许可权限,用它来确定谁可以通过何种方式对文件和目录进行访问和操作. 文件或目录的访问权限分为只读,只写和可执行三种.以文件为例,只读权限表示只允许读其内容,而禁 ...

  10. (转载)HTML5 LocalStorage 本地存储

    原文地址:http://www.cnblogs.com/xiaowei0705/archive/2011/04/19/2021372.html HTML5 LocalStorage 本地存储 说到本地 ...