private static ButtonState ConvertToButtonState(HeaderItemState state) { if (state == HeaderItemState.Pressed) { return(ButtonState.Pushed); } return(ButtonState.Normal); }
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)); } }
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); }
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); }
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); }
private static ButtonState ConvertToButtonState(HeaderItemState state) { if (state == HeaderItemState.Pressed) { return ButtonState.Pushed; } return ButtonState.Normal; }