
Код: Выделить всё
private void button1_Paint(object sender, PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(VisualStyleElement.Window.MinButton.Normal))
{
VisualStyleRenderer renderer = new VisualStyleRenderer(VisualStyleElement.Window.MinButton.Normal);
Size closeButtonSize = renderer.GetPartSize(e.Graphics, ThemeSizeType.True);
// Resize the button control to match the close button icon size
button1.Width = closeButtonSize.Width;
button1.Height = closeButtonSize.Height;
Rectangle rectangle1 = new Rectangle(0, 0, button1.Width, button1.Height);
renderer.DrawBackground(e.Graphics, rectangle1);
}
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... ze-buttons