Example #1
0
        private int scUpDown_SubClassedWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case CustomWin32.WM_PAINT:
            {
                //------------------------
                // redraw
                IntPtr   hDC = CustomWin32.GetWindowDC(scUpDown.Handle);
                Graphics g   = Graphics.FromHdc(hDC);

                DrawIcons(g);

                g.Dispose();
                CustomWin32.ReleaseDC(scUpDown.Handle, hDC);
                //------------------------

                // return 0 (processed)
                m.Result = IntPtr.Zero;

                //------------------------
                // validate current rect
                Rectangle rect = new Rectangle();

                CustomWin32.GetClientRect(scUpDown.Handle, ref rect);
                CustomWin32.ValidateRect(scUpDown.Handle, ref rect);
                //------------------------
            }
                return(1);
            }

            return(0);
        }
Example #2
0
        private void UpdateUpDown()
        {
            if (bUpDown)
            {
                if (CustomWin32.IsWindowVisible(scUpDown.Handle))
                {
                    Rectangle rect = new Rectangle();

                    CustomWin32.GetClientRect(scUpDown.Handle, ref rect);
                    CustomWin32.InvalidateRect(scUpDown.Handle, ref rect, true);
                }
            }
        }