protected virtual void ButtonBase_DrawFocus(ButtonBase button, Graphics dc)
{
Color focus_color = button.ForeColor;
int inflate_value = -3;
if (!(button is CheckBox) && !(button is RadioButton)) {
inflate_value = -4;
if (button.FlatStyle == FlatStyle.Popup && !button.is_pressed)
focus_color = ControlPaint.Dark(button.BackColor);
dc.DrawRectangle (ResPool.GetPen (focus_color), button.ClientRectangle.X, button.ClientRectangle.Y,
button.ClientRectangle.Width - 1, button.ClientRectangle.Height - 1);
}
if (button.Focused) {
Rectangle rect = Rectangle.Inflate (button.ClientRectangle, inflate_value, inflate_value);
ControlPaint.DrawFocusRectangle (dc, rect);
}
}