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. java MAVEN 项目出现红叉

    pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w ...

  2. Office 365 系列一 ------- 如何单个安装Office 客户端和Skype for business

    当我们注册好或者购买好 Office 365后,我们的单个用户如何进行在线的.流式的方式安装好我们的客户端,特别是对于我们非IT部门来说,这是一个比较为难的事情, 经常需要我们的IT去到同事的电脑旁边 ...

  3. U盘安装WIN10专业版

    安装环境1个SSD,2个SATA盘. 安装时把2个SATA盘拔掉,并使SSD在BISO中的地位为0区的MASTER,否则安装时会出现,无法创建当前分区,和新建当前分区. 步骤:下载win10正式专业版 ...

  4. iOS(本地通知与远程通知)

    iOS 推送通知有两种:本地推送.远程推送. 本地推送 :  在不需要联网的情况下,由APP发出推送,常用于某一时刻的通知,如闹钟.本地通送有局限性在于当APP处于后台或者退出时就无法发出通知. 远程 ...

  5. MyBatis复习【简单配置CRUD】

    这里的案例集成了log4j的日志框架,项目架构: 用到的jar文件 添加配置文件:mybatis-config.xml  和dao层配置文件StudentDao.xml 这里书写了个简单的案例仅为了说 ...

  6. WPF触发器的使用

    WPF中定义了五个触发器类:Trigger.MultiTrigger.DataTrigger.multiDataTrigger.EventTrigger.下面我来介绍一下怎么使用这几个触发器的使用方法 ...

  7. Oracle nvchar2和varchar2区别分析

    Oracle nvchar2和varchar2区别分析: [注意]VARCHAR2是Oracle提供的特定数据类型,Oracle可以保证VARCHAR2在任何版本中该数据类型都可以向上和向下兼容.VA ...

  8. Postgresql死锁处理

    今天遇到Postgresql的一个问题,部分表记录的update一直无效报错,初步判断为锁表,赶紧进行解决. 1. 查询死锁进程列表 select * from pg_stat_activity wh ...

  9. String类的构造方法详解

    package StringDemo; //String类的构造方法详解 //方法一:String(); //方法二:String(byte[] bytes) //方法三:String (byte[] ...

  10. Spring整合jdbc

    首先web.xml文件跟往常一样,加载spring容器和加载org.springframework.web.context.ContextLoaderListener读取applicationCont ...