SetStyle(ControlStyles.UserPaint, true)
SetStyle(ControlStyles.AllPaintingInWmPaint, true)// 禁止擦除背景.
SetStyle(ControlStyles.DoubleBuffer, true)// 双缓冲
UserPaint
如果为 true,控件将自行绘制,而不是通过 *** 作系统来绘制。此样式仅适用于派生自 Control 的类。
AllPaintingInWmPaint
如果为 true,控件将忽略 WM_ERASEBKGND 窗口消息以减少闪烁。仅当 UserPaint 位设置为 true 时,才应当应用该样式。
DoubleBuffer
如果为 true,则绘制在缓冲区中进行,完成后将结果输出到屏幕上。双重缓冲区可防止由控件重绘引起的闪烁。要完全启用双重缓冲,还必须将 UserPaint 和 AllPaintingInWmPaint 样式位设置为 true。
this.SuspendLayout()// 加载panel
this.ResumeLayout()
this.PerformLayout()
wandsg@163.com
发代码看看
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)