Skip to content

Instantly share code, notes, and snippets.

@haroldcris
Created October 4, 2017 02:29
Show Gist options
  • Save haroldcris/cd785222125227425be3d51b1cbf8bb9 to your computer and use it in GitHub Desktop.
Save haroldcris/cd785222125227425be3d51b1cbf8bb9 to your computer and use it in GitHub Desktop.
//
// Taken from https://cborrow.wordpress.com/2009/11/13/c-remove-flicker-in-mdi-applications/
//
const int WM_NCPAINT = 0x85;
const int WM_SIZE = 0x05;
//Add this to MDI CHILD FORM
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_NCPAINT)
{
if (this.WindowState == FormWindowState.Maximized)
return;
}
if (m.Msg == WM_SIZE)
{
if (this.WindowState == FormWindowState.Maximized)
return;
}
base.WndProc(ref m);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment