protected override void OnResize(EventArgs e) { base.OnResize(e); // Invalidate none client area HeaderPanelNativeMethods.RedrawWindow(this.Handle, IntPtr.Zero, IntPtr.Zero, 0x0400 /*RDW_FRAME*/ | 0x0100 /*RDW_UPDATENOW*/ | 0x0001 /*RDW_INVALIDATE*/); }
protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCCALCSIZE: WmNCCalcSize(ref m); break; case WM_NCPAINT: IntPtr hDC = HeaderPanelNativeMethods.GetWindowDC(m.HWnd); if (hDC != IntPtr.Zero) { using (Graphics canvas = Graphics.FromHdc(hDC)) { PaintNonClientArea(canvas); } HeaderPanelNativeMethods.ReleaseDC(m.HWnd, hDC); } m.Result = IntPtr.Zero; break; } base.WndProc(ref m); }