如何使用C#(Windows窗体)启用控件的双缓冲?
如何使用C#(Windows窗体)启用控件的双缓冲?
我有一个面板控件,我正在绘制内容,也是一个所有者绘制的选项卡控件。 两者都有闪烁,所以如何启用双缓冲?
在控件的构造函数中,适当地设置DoubleBuffered属性和/或ControlStyle。
例如,我有一个简单的DoubleBufferedPanel,其构造函数如下:
this.DoubleBuffered = true; this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.ContainerControl | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor , true);
一些信息在这里:
如何在表单上双重缓冲.NET控件?
使用inheritance自System.Windows.Forms.Control的DoubleBuffered属性。
上述就是C#学习教程:如何使用C#(Windows窗体)启用控件的双缓冲?分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
System.Windows.Forms.Form myForm = new System.Windows.forms.Form(); myForm.DoubleBuffered = true;
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/1026726.html