Esempio n. 1
0
 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*/);
 }
Esempio n. 2
0
        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);
        }