.NET Control.Update 方法在无效后需要吗?
在我的代码中,仅调用 .Invalidate 会执行与调用更新相同的操作。事实上,当我随后调用 .Update 时,控件的闪烁似乎更严重。我在文档页面上读到以下内容:
“Update 方法只是强制立即绘制控件”
这对我来说很困惑,因为所有在线重绘示例都告诉我指定一个无效区域,然后调用更新以获得最少的闪烁量。根据这些示例,我假设更新调用是强制性的。
In my code, just calling .Invalidate does the same thing as if an update is called. In fact, when I call .Update afterward, the flicker for the control seems to be worse. I read on the documentation page the following:
"The Update method just forces the control to be painted immediately"
This is confusing for me as all the online examples of redrawing tell me to specify an invalidated region, then call the update in order to get the least amount of flicker. Based on those examples, I would assume that the update call is mandatory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此博文介绍了 Control.Invalidate 和 Control 之间的差异。更新
This blog post describes the differences between Control.Invalidate and Control.Update