[C#.NET]
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方法。
随机推荐
- python基础知识2——基本的数据类型——整型,长整型,浮点型,字符串
磨人的小妖精们啊!终于可以归置下自己的大脑啦,在这里我要把--整型,长整型,浮点型,字符串,列表,元组,字典,集合,这几个知识点特别多的东西,统一的捯饬捯饬,不然一直脑袋里面乱乱的. 对于Python ...
- Winform 窗体单例
有窗体Form1和窗体Form2,单击Form1上按钮,只弹出一个Form2. Form2里自定义一个方法,里面判断是否弹出Form2,没有时弹出Form2. public static Form2 ...
- Python全栈开发day5
一.lambda表达式 对于简单的函数,存在一种简便的表示方式,即:lambda表达式 1 2 3 >>> shaw = lambda x,y:x + y >>> ...
- asp.net前台代码中引入namespace的方法
<%@ import NameSpace="System.Data.OleDb" %>
- linux入门级常用命令
1) 关闭Linux系统的命令:init 02) Linux终端:Linux终端也称为虚拟控制台.Linux终端采用字符命令行方式工作,用户通过键盘输入命令,通过Linux终端对系统进行控制.3) 切 ...
- 常用前端框架Angular和React的一些认识
为什么要用AngularJs? 要了解为什么使用AngularJS首先就要接受它的思想: 首先,angularJS借助了传统MVC的架构模式(model模型 view视图 controller控制 ...
- ES 集群
http://www.cnblogs.com/o-andy-o/p/5067184.html
- dos 批处理删除svn目录
转自 http://blog.sina.com.cn/mpl398235717 @echo offecho ********************************************** ...
- exception 'yii\base\ErrorException' with message 'Class 'MongoClient' not found'
问题描述: 本来项目运行的好好的,搬了一次办公室(电脑主机一起搬的),第二天的时候就登录不了了. php版本和扩展没有改变,且没有修改任何配置,我尝试重启php5-fpm 服务,又重启nginx服务, ...
- JavaWeb---设置content-disposition响应头,让浏览器下载文件
package com.zyz; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServlet ...