public override void PaintBackground(IGUIContext ctx, Widget widget) { if (widget.CanPaint) { switch (ButtonStyle) { case ButtonStyles.Gradient: base.PaintBackground(ctx, widget); break; case ButtonStyles.Glossy: ctx.DrawButton(widget.Bounds, BackColorBrush.Color, (BackColorBrush as LinearGradientBrush).GradientColor, BorderColorPen.Color); break; case ButtonStyles.Flat: if (BackColorBrush.Color != Color.Empty) { ctx.FillRectangle(new SolidBrush(BackColorBrush.Color), widget.Bounds); } DrawBorder(ctx, widget); break; } } }