* UIListBox, UIImageListBox: 防止闪烁

This commit is contained in:
Sunny 2021-08-04 12:14:33 +08:00
parent 1408316ed6
commit dc91d5f879
7 changed files with 21 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -362,6 +362,21 @@ namespace Sunny.UI
}
}
protected override void WndProc(ref Message m)
{
if (IsDisposed || Disposing) return;
if (IsHandleCreated)
{
if (m.Msg == Win32.User.WM_ERASEBKGND)
{
m.Result = IntPtr.Zero;
return;
}
}
base.WndProc(ref m);
}
public ImageListBox()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);

View File

@ -523,6 +523,12 @@ namespace Sunny.UI
{
ItemsInsert?.Invoke(this, EventArgs.Empty);
}
if (m.Msg == Win32.User.WM_ERASEBKGND)
{
m.Result = IntPtr.Zero;
return;
}
}
base.WndProc(ref m);