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. mongodb morphia关联查询一例

    //...此处省略了import... /** * Created by shenzhigang on 4/15/16. */ public class Main { public static vo ...

  2. EntityFramework Reverse POCO Generator工具

    https://visualstudiogallery.msdn.microsoft.com/ee4fcff9-0c4c-4179-afd9-7a2fb90f5838

  3. <textarea>没有内容时,按回车键,设置光标不换行

    $("textarea").val($("textarea").val().replace(/\n/g,""));

  4. 学习shell脚本笔记

    1.if 是单分支语句,使用格式如下: if condition ; then statement ….. fi 2.if … else 是双分支语句,使用格式如下: if condition ; t ...

  5. 介绍开源的.net通信框架NetworkComms框架 源码分析(二十二 )TCPConnectionStatic

    原文网址: http://www.cnblogs.com/csdev Networkcomms 是一款C# 语言编写的TCP/UDP通信框架  作者是英国人  以前是收费的 目前作者已经开源  许可是 ...

  6. mysql 常用基础

    登录命令 -h远程IP地址 -u用户名 -p密码 -P端口 mysql -h127.0.0.1 -uroot -p21313 -P3306 新建用户 insert into mysql.user(Ho ...

  7. MyEclipse/Eclipse新建项目并且部署到服务器(tomcat)下

    1新建项目:file/new/web project/项目名/ok 2部署到tomcat下:tomcat右单机>>add/remove/选择项目/添加/完成(tomcat下有新建的项目) ...

  8. 【NoSql】MongoDb

    [NoSql]MongoDb 一. 文档 1. 官网 2. C# Driver 3. C# 开发文档 二. 命令 1. --config "C:\mongodb\mongod.cfg&quo ...

  9. 极光推送NotificationServiceTest.appex文件变红不存在丢失解决办法

    这个图片是文件丢失的 创建.appex文件 创建.appex文件 把极光demo里面的这两个文件复制粘贴到新的文件件(新创建的文件是 UIViewController类型的所以就把 (Notifica ...

  10. C#获取程序集自动增加的版本号和编译时间

    1. 首先找到文件AssemblyInfo.cs, 路径如下: 2. 修改版本的格式,修改后,程序每次编译,程序集的版本号都会自增. 修改前: [assembly: AssemblyVersion(& ...