Hello Everybody,
I would like to change windows default minimize style for my C# project and add another style. Is it possible to change minimize style?
If is it possible please help me.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 13, 2013, 7:54 PM EST
You can change using VisualStyleRenderer. But you have to create your own graphics image.
Paste the below code into your Windows Form. Handle the form's Paint event and call the ChangeMinimizeButtonStyle method from the Paint event-handling method, passing e as PaintEventArgs.
public void DrawVisualStyleElementWindowCloseButton2(PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(
VisualStyleElement.Window.MinButton.Normal))
{
VisualStyleRenderer renderer =
new VisualStyleRenderer(VisualStyleElement.Window.MinButton.Normal);
Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
renderer.DrawBackground(e.Graphics, rectangle1);
e.Graphics.DrawString("VisualStyleElement.Window.MinButton.Normal",
this.Font, Brushes.Black, new Point(10, 10));
}
else
e.Graphics.DrawString("This element is not defined in the current visual style.",
this.Font, Brushes.Black, new Point(10, 10));
}
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 13, 2013, 7:54 PM EST
You can change using VisualStyleRenderer. But you have to create your own graphics image.
Paste the below code into your Windows Form. Handle the form's Paint event and call the ChangeMinimizeButtonStyle method from the Paint event-handling method, passing e as PaintEventArgs.
public void ChangeMinimizeButtonStyle (PaintEventArgs e)
{
if (VisualStyleRenderer.IsElementDefined(
VisualStyleElement.Window.MinButton.Normal))
{
VisualStyleRenderer renderer =
new VisualStyleRenderer(VisualStyleElement.Window.MinButton.Normal);
Rectangle rectangle1 = new Rectangle(10, 50, 50, 50);
renderer.DrawBackground(e.Graphics, rectangle1);
e.Graphics.DrawString("VisualStyleElement.Window.MinButton.Normal",
this.Font, Brushes.Black, new Point(10, 10));
}
else
e.Graphics.DrawString("This element is not defined in the current visual style.",
this.Font, Brushes.Black, new Point(10, 10));
}