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. genymotion启动虚拟机遇到问题解决方法步骤

    通过在不做任务设置时启动genymotion,会遇到一些问题: 会弹出类似如下问题: 要解决这样问题,首先要知道是什么问题,一般按提示在VitualBox中启动虚拟机就可以知道是什么问题. “To f ...

  2. 【初学者教程】在电脑上安装Python,写第一个程序

    欢迎来到Python的世界 1.存在Python 2和Python 3两个版本,我该用哪个?如果书是关于2的,下载2:如果书是关于3的,就下载3.建议用Python 3,不过用2也是可以的. 2.下载 ...

  3. python--day2--基础数据类型与变量

    笔者:QQ:   360212316 python控制语句 for循环语句示例: for i in range(10): print(i) for循环语句示例1: for i in range(10) ...

  4. IOS系列swift语言之课时五

    过了几天没来理博客了,这次我们要讲的有:类,属性,初始化init(),初始化器,构造器等 直接刷代码了....... //: Playground - noun: a place where peop ...

  5. wpf 遮住输入法 问题

    可以参考这个代码   http://www.cnblogs.com/Leaco/p/3164394.html 当你发现没用的时候 可以改这句代码  var hwnd = ((HwndSource)Pr ...

  6. IBatis 简易框架搭建

    1.练习框架 ibatis主要dll介绍 IBatisNet.Common.dll 由DataAccess和DataMapper组成的共享程序集 IBatisNet.Common.Logging.Lo ...

  7. 全是套路——BFS

    #include <iostream> #include <vector> #include <string> #include <vector> #i ...

  8. <![CDATA[ ]]> 的作用

    在xml文件中 一些特殊字符需要去除其本意,就要用到 <![CDATA[    ]]>,,比如 ibitis的sqlmap.xml 中  要比较大小不能直接用 < 或者 > , ...

  9. java操作数据库

    增加 public String addParent(Parent pp) { Connection conn=new ConntionUtil().openConnection(); Prepare ...

  10. hdu 3579 Hello Kiki (中国剩余定理)

    Hello Kiki Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...