public virtual void DrawButton(Graphics g, bool paintBackground, Color bgColor) { if (!Visible || Skin == null) { return; } // paint buffered background image if (paintBackground) { using (SolidBrush bg = new SolidBrush(bgColor)) g.FillRectangle(bg, Bounds); } if (this.Enabled) { switch (this.State) { case CaptionButtonState.Normal: Skin.NormalState(g, Bounds, bgColor); break; case CaptionButtonState.Pressed: Skin.ActiveState(g, Bounds, bgColor); break; case CaptionButtonState.Over: Skin.HoverState(g, Bounds, bgColor); break; } } else { Skin.DisabledState(g, Bounds, bgColor); } }