1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows.Forms;
5 namespace WfGUI.Forms
6 {
7 ///<summary>
8 /// 不会闪烁的TabContriol
9 /// </summary>
10 public class NoFlashTabControl : TabControl
11 {
12 ///<summary>
13 /// 构造函数,设置控件风格
14 ///</summary>
15 public NewTabControl()
16 {
17 SetStyle
18 ( ControlStyles.AllPaintingInWmPaint //全部在窗口绘制消息中绘图
19 | ControlStyles.OptimizedDoubleBuffer //使用双缓冲
20 , true);
21 }
22 ///<summary>
23 /// 设置控件窗口创建参数的扩展风格
24 ///</summary>
25 protected override CreateParams CreateParams
26 {
27 get
28 {
29 CreateParams cp = base.CreateParams;
30 cp.ExStyle |= 0 x02000000;
31 return cp;
32 }
33 }
34 }
35 }