Пример #1
0
        private static ButtonState ConvertToButtonState(HeaderItemState state)
        {
            if (state == HeaderItemState.Pressed)
            {
                return(ButtonState.Pushed);
            }

            return(ButtonState.Normal);
        }
Пример #2
0
 public static void DrawHeader(Graphics g, Rectangle bounds, HeaderItemState state)
 {
     if (RenderWithVisualStyles)
     {
         InitializeRenderer((int)state);
         visualStyleRenderer.DrawBackground(g, bounds);
     }
     else
     {
         ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
     }
 }
Пример #3
0
 public static void DrawHeader(Graphics g, Rectangle bounds, HeaderItemState state)
 {
     if (RenderWithVisualStyles)
     {
         InitializeRenderer((int)state);
         visualStyleRenderer.DrawBackground(g, bounds);
     }
     else
     {
         ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
     }
 }
Пример #4
0
        public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, HeaderItemState state)
        {
            Color text;

            if (RenderWithVisualStyles)
            {
                InitializeRenderer((int)state);
                visualStyleRenderer.DrawBackground(g, bounds);
                visualStyleRenderer.DrawImage(g, imageBounds, image);
                text = visualStyleRenderer.GetColor(ColorProperty.TextColor);
            }
            else
            {
                ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
                g.DrawImage(image, imageBounds);
                text = SystemColors.ControlText;
            }

            TextRenderer.DrawText(g, headerText, font, Rectangle.Inflate(bounds, -3, -3), text, flags);
        }
Пример #5
0
 public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, Image image, Rectangle imageBounds, HeaderItemState state)
 {
     DrawHeader(g, bounds, headerText, font, TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.Left | TextFormatFlags.NoPrefix | TextFormatFlags.EndEllipsis, image, imageBounds, state);
 }
Пример #6
0
 public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, HeaderItemState state)
 {
     DrawHeader(g, bounds, headerText, font, TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.Left | TextFormatFlags.NoPrefix | TextFormatFlags.EndEllipsis, state);
 }
Пример #7
0
        private static ButtonState ConvertToButtonState(HeaderItemState state)
        {
            if (state == HeaderItemState.Pressed)
            {
                return ButtonState.Pushed;
            }

            return ButtonState.Normal;
        }
Пример #8
0
        public static void DrawHeader(Graphics g, Rectangle bounds, string headerText, Font font, TextFormatFlags flags, Image image, Rectangle imageBounds, HeaderItemState state)
        {
            Color text;
            if (RenderWithVisualStyles)
            {
                InitializeRenderer((int)state);
                visualStyleRenderer.DrawBackground(g, bounds);
                visualStyleRenderer.DrawImage(g, imageBounds, image);
                text = visualStyleRenderer.GetColor(ColorProperty.TextColor);
            }
            else
            {
                ControlPaint.DrawButton(g, bounds, ConvertToButtonState(state));
                g.DrawImage(image, imageBounds);
                text = SystemColors.ControlText;
            }

            TextRenderer.DrawText(g, headerText, font, Rectangle.Inflate(bounds, -3, -3), text, flags);
        }