public void DrawTabCloseButton(System.Windows.Forms.DrawItemEventArgs e, Rectangle rect, VisualStyleElement style, ButtonState state) { if (VisualStyleRenderer.IsSupported) { if (VisualStyleRenderer.IsElementDefined(style)) { VisualStyleRenderer renderer = new VisualStyleRenderer(style); renderer.DrawBackground(e.Graphics, rect); return; } } ControlPaint.DrawCaptionButton(e.Graphics, rect, CaptionButton.Close, state); }
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.