[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方法。
随机推荐
- JavaScript中的枚举
在JavaScript目前的版本中,没有枚举这个概念(当然,ECMA-262第三版中已经将enum作为关键字保留). 然而,如同JavaScript中没有class一样,但我们仍然可以通过间接的方式- ...
- Word2013创建目录
1.写好文档内容后,将光标移到标题行,点击“开始”里的“样式”->“创建样式”,为该标题创建一个新的样式,同时点击“修改”,在打开的窗口中选择左下方的“格式”,进行标题格式的调整.依次可设定子标 ...
- JavaScript DOM编程艺术读书笔记(二)
第五章 最佳实践 平稳退化(graceful degradation):如果正确使用了JavaScript脚本,可以让访问者在他们的浏览器不支持JavaScript的情况下仍能顺利地浏览你网站.虽然某 ...
- php多条件搜索
PHP多条件查询 December : Tuesdayby 小屋 在我们的网站设计过程中,经常会用到多条件查询,本文的源码是一个二手房屋查询的例子.在本例中,我们要实现能够通过地理位置,物业类型,房屋 ...
- 使用Linux碎解一
一.安装VMwarestation. 二.安装Linux系统(这里是CentOS7) 步骤: #==========================part1===================== ...
- js中自己实现each方法来遍历多维数组
- 图情期刊要求2015(A,B,C类)
中国图书馆学报+情报学报+大学图书馆学报+图书情报工作+图书情报知识+情报理论与实践+国家图书馆学刊+情报杂志+图书与情报+情报科学+图书馆杂志+图书馆建设+情报资料工作+图书馆论坛+现代图书情报技术 ...
- XdbxAnalysis
Tree: TXdbxAnalysis; FDataStream: TMemoryStream; {FDataStream:= TMemoryStream.Create; FDataStream ...
- array_filter,匿名函数
static function get_categoryII() { return array( array('id' => 1, 'c1id' => 1, 'name' => '1 ...
- 九宝老师微信小程序开发的过程