WinForm–Invalidate、Update、Refresh的区别
来源:互联网 发布:mac装win10设置电源 编辑:程序博客网 时间:2024/06/15 19:11
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方法。
- WinForm–Invalidate、Update、Refresh的区别
- WinForm--Invalidate、Update、Refresh的区别
- WinForm-Invalidate、Update、Refresh的区别
- Invalidate、Update、Refresh的作用和区别
- Invalidate、Update、Refresh的作用和区别
- Invalidate、Update、Refresh的作用和区别
- Invalidate,Update与Refresh的区别
- Invalidate, Repaint, Update, Refresh区别
- .net c#控件 Invalidate、Update、Refresh的区别
- Winform程序中,Invalidate、Update和Refresh方法介绍
- Invalidate、Refresh、Update
- Control.Invalidate, Control.Update and Control.Refresh 有什么区别
- Viewer之update和refresh方法的区别
- invalidate、postInvalidate的区别
- Invalidate以及Invalidate(false)和Invalidate(true)的区别
- Invalidate以及Invalidate(false)和Invalidate(true)的区别
- Invalidate以及Invalidate(false)和Invalidate(true)的区别
- Invalidate以及Invalidate(false)和Invalidate(true)的区别
- javascript 字符串 减0( -0),实现类型转换
- 使用Gradle构建Android项目
- 【转】C# 连接 MySQL 并进行数据库操作(入门篇)
- Struts2初学devMode发展模式,更改action出现映射错误解决办法(原因是版本问题,轻松解决)
- ACM学习路径
- WinForm–Invalidate、Update、Refresh的区别
- flash builder 4.6 内存不足解决方法
- php抽奖、随机广告算法
- SQL优化总结
- php文件操作2
- java序列化和反序列化初解和面试需求
- find命令
- [LA 6751 Mixed Flight Plans] Floyd+图上按链DP
- 基于ISO8583协议服务端与POS机数据交互