protected override void WndProc(ref Message m)
        {
            PAINTSTRUCT ps = new PAINTSTRUCT();
            switch (m.Msg)
            {
                case WM_PAINT:
                    if (!_bPainting)
                    {
                        _bPainting = true;
                        // start painting engine
                        BeginPaint(m.HWnd, ref ps);
                        if (!_bFading)
                        drawCombo();
                        ValidateRect(m.HWnd, ref ps.rcPaint);
                        // done
                        EndPaint(m.HWnd, ref ps);
                        _bPainting = false;
                        m.Result = MSG_HANDLED;
                    }
                    else
                    {
                        base.WndProc(ref m);
                    }
                    break;

                case WM_MOUSEMOVE:
                    if (!_bMoved)
                    {
                        if (TransitionGraphic != null)
                        {
                            RECT tr = comboButton();
                            _bFading = true;
                            cTransition ts = new cTransition(m.HWnd, IntPtr.Zero, TransitionGraphic, new Rectangle(tr.Left, tr.Top, tr.Right - tr.Left, tr.Bottom - tr.Top));
                        }
                    }
                    if (overButton())
                        _bMoved = true;
                    base.WndProc(ref m);
                    break;

                case WM_MOUSELEAVE:
                    _bMoved = false;
                    _bFading = false;
                    base.WndProc(ref m);
                    break;

                default:
                    base.WndProc(ref m);
                    break;
            }
        }
 private void scrollFader()
 {
     return;
     SB_HITEST hitTest = scrollbarHitTest();
     if (hitTest == SB_HITEST.button)
     {
         Point pst = getScrollBarThumb();
         if (TransitionGraphic != null)
         {
             cTransition ts;
             RECT tr = new RECT();
             if (Direction == Orientation.Horizontal)
             {
                 GetWindowRect(_hScrollBarWnd, ref tr);
                 ts = new cTransition(_hMaskWnd, _hScrollBarWnd, TransitionGraphic, new Rectangle(pst.X, 0, pst.Y - pst.X, tr.Bottom));
             }
             else
             {
                 ts = new cTransition(_hMaskWnd, _hScrollBarWnd, TransitionGraphic, new Rectangle(0, pst.X, _iArrowCx, pst.Y - pst.X));
             }
         }
     }
 }
示例#3
0
 private void ctl_MouseEnter(object sender, EventArgs e)
 {
     if (TransitionGraphic != null)
     {
         Control ct = (Control)sender;
         cTransition ts = new cTransition(ct.Handle, IntPtr.Zero, _oTransitionMask, ct.ClientRectangle);
     }
 }