示例#1
0
        private void WmPaint(ref Message m)
        {
            if (base.DropDownStyle == ComboBoxStyle.Simple)
            {
                base.WndProc(ref m);
                return;
            }
            else//if (base.DropDownStyle == ComboBoxStyle.DropDown)
            {
                if (!_bPainting)
                {
                    PAINTSTRUCT ps =
                        new PAINTSTRUCT();

                    _bPainting = true;
                    WinMethod.BeginPaint(m.HWnd, ref ps);

                    RenderComboBox(ref m);

                    WinMethod.EndPaint(m.HWnd, ref ps);
                    _bPainting = false;
                    m.Result   = KnownParam.TRUE;
                }
                else
                {
                    base.WndProc(ref m);
                }
            }
            //else
            //{
            //    base.WndProc(ref m);
            //    RenderComboBox(ref m);
            //}
        }
 protected override void WndProc(ref Message m)
 {
     switch (m.Msg)
     {
         case WinMsgs.WM_PAINT:
             if (!_bPainting)
             {
                 PAINTSTRUCT ps =
                     new PAINTSTRUCT();
                 _bPainting = true;
                 WinMethod.BeginPaint(m.HWnd, ref ps);
                 DrawUpDownButton();
                 WinMethod.EndPaint(m.HWnd, ref ps);
                 _bPainting = false;
                 m.Result = KnownParam.TRUE;
             }
             else
             {
                 base.WndProc(ref m);
             }
             break;
         default:
             base.WndProc(ref m);
             break;
     }
 }
示例#3
0
 public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
示例#4
0
 public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
示例#5
0
        private void WmPaint(ref Message m)
        {

            if (base.DropDownStyle == ComboBoxStyle.Simple)
            {
                base.WndProc(ref m);
                return;
            }
            else//if (base.DropDownStyle == ComboBoxStyle.DropDown)
            {
                if (!_bPainting)
                {
                    PAINTSTRUCT ps =
                        new PAINTSTRUCT();

                    _bPainting = true;
                    WinMethod.BeginPaint(m.HWnd, ref ps);

                    RenderComboBox(ref m);

                    WinMethod.EndPaint(m.HWnd, ref ps);
                    _bPainting = false;
                    m.Result = KnownParam.TRUE;
                }
                else
                {
                    base.WndProc(ref m);
                }
            }
            //else
            //{
            //    base.WndProc(ref m);
            //    RenderComboBox(ref m);
            //}
        }
示例#6
0
 public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
示例#7
0
 public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);