Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
16712 | Jul 22,2004 12:17 PM UTC | Feb 10,2005 06:16 PM UTC | WinForms | 8 |
![]() |
Tags: GridControl |
protected override void WndProc(ref Message msg)
{
if (msg.Msg == WM_PAINT && Updating)
{
PAINTSTRUCT ps = new PAINTSTRUCT();
BeginPaint(Handle, ref ps);
EndPaint(Handle, ref ps);
msg.Result = IntPtr.Zero;
return;
} base.WndProc(ref msg);
}
[StructLayout(LayoutKind.Sequential)]
public struct PAINTSTRUCT
{
// Fields
public IntPtr hdc;
public bool fErase;
public int rcPaint_left;
public int rcPaint_top;
public int rcPaint_right;
public int rcPaint_bottom;
public bool fRestore;
public bool fIncUpdate;
public int reserved1;
public int reserved2;
public int reserved3;
public int reserved4;
public int reserved5;
public int reserved6;
public int reserved7;
public int reserved8;
}
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true, CallingConvention=CallingConvention.Winapi)]
public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT lpPaint);
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true, CallingConvention=CallingConvention.Winapi)]
public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT lpPaint);
internal const int WM_PAINT = 15; // 0x000f
Stefan
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.