* 减少窗体闪烁
This commit is contained in:
parent
2682357470
commit
45d9bb7648
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -48,6 +48,14 @@ namespace Sunny.UI
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.Selectable, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
base.DoubleBuffered = true;
|
||||
UpdateStyles();
|
||||
|
||||
edit.Font = UIFontColor.Font;
|
||||
edit.Left = 3;
|
||||
edit.Top = 3;
|
||||
|
@ -39,6 +39,14 @@ namespace Sunny.UI
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.Selectable, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
DoubleBuffered = true;
|
||||
UpdateStyles();
|
||||
|
||||
box.SelectedIndexChanged += Box_SelectedIndexChanged;
|
||||
box.DataSourceChanged += Box_DataSourceChanged;
|
||||
box.DisplayMemberChanged += Box_DisplayMemberChanged;
|
||||
|
@ -39,7 +39,12 @@ namespace Sunny.UI
|
||||
|
||||
public UITabControl()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
DoubleBuffered = true;
|
||||
UpdateStyles();
|
||||
|
||||
ItemSize = new Size(150, 40);
|
||||
DrawMode = TabDrawMode.OwnerDrawFixed;
|
||||
@ -79,13 +84,6 @@ namespace Sunny.UI
|
||||
DrawedIndex = SelectedIndex;
|
||||
}
|
||||
|
||||
protected override void OnSelected(TabControlEventArgs e)
|
||||
{
|
||||
base.OnSelected(e);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
if (ForbidCtrlTab)
|
||||
|
@ -1417,7 +1417,15 @@ namespace Sunny.UI
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
switch (m.Msg)
|
||||
{
|
||||
case Win32.User.WM_ERASEBKGND:
|
||||
m.Result = IntPtr.Zero;
|
||||
break;
|
||||
default:
|
||||
base.WndProc(ref m);
|
||||
break;
|
||||
}
|
||||
|
||||
if (m.Msg == Win32.User.WM_NCHITTEST && ShowDragStretch && WindowState == FormWindowState.Normal)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user