)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the ControlBox buttons appearance in WinForms MetroForm?

Platform: WinForms |
Control: MetroForm |
Published Date: May 11, 2016 |
Last Revised Date: January 6, 2020

Customize the control box appearance

In MetroForm at present, there is no option to customize ControlBox button bounds and appearance cannot be customized. If user would like to customize the ControlBox, that can be achieved by using property named CaptionImages and by handling below events.

 

ImageMouseMove - This event is raised when the mouse pointer enters CaptionImage bounds and used to display the ToolTip for Control Box buttons.

ImageMouseUp - This event raises when Mouse pointer selection is done on CaptionImage bounds and Mouse selection is released.

ImageMouseEnter - This event is raised when Mouse pointer enters CaptionImage bounds. It is used to show highlight effect for CaptionImage back color.

ImageMouseLeave - This event is raised when Mouse pointer leaves CaptionImage bounds. It is used to show highlight effect for CaptionImage back color.

C#

//To Set Properties for the CaptionImages
captionImage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
captionImage1.Image = global::Metroform.Properties.Resources.Close;
captionImage1.Location = new System.Drawing.Point(760, 4);
captionImage1.Name = "CaptionImage1";
captionImage2.BackColor = System.Drawing.Color.Transparent;
captionImage2.Image = global::Metroform.Properties.Resources.max;
captionImage2.Location = new System.Drawing.Point(730, 4);
captionImage2.Name = "CaptionImage2";
captionImage3.BackColor = System.Drawing.Color.Transparent;
captionImage3.Image = global::Metroform.Properties.Resources.Minus;
captionImage3.Location = new System.Drawing.Point(703, 4);
captionImage3.Name = "CaptionImage3";
//To add Caption Images into the MetroForm
this.CaptionImages.Add(captionImage1);
this.CaptionImages.Add(captionImage2);
this.CaptionImages.Add(captionImage3);

VB

'To Set Properties for the CaptionImages
captionImage1.BackColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(192))))), (CInt(Fix((CByte(0))))), (CInt(Fix((CByte(0))))))
captionImage1.Image = My.Resources.Close
captionImage1.Location = New System.Drawing.Point(760, 4)
captionImage1.Name = "CaptionImage1"
captionImage2.BackColor = System.Drawing.Color.Transparent
captionImage2.Image = My.Resources.max
captionImage2.Location = New System.Drawing.Point(730, 4)
captionImage2.Name = "CaptionImage2"
captionImage3.BackColor = System.Drawing.Color.Transparent
captionImage3.Image = My.Resources.Minus
captionImage3.Location = New System.Drawing.Point(703, 4)
captionImage3.Name = "CaptionImage3"
'To add Caption Images into the MetroForm
Me.CaptionImages.Add(captionImage1)
Me.CaptionImages.Add(captionImage2)
Me.CaptionImages.Add(captionImage3)
Me.MaximizeBox = False
Me.MinimizeBox = False

                          

Customize the ControlBox appearance in MetroForm with image

Figure 1. Customize the ControlBox appearance in MetroForm with image.

Samples:

C#: How to customize the ControlBox buttons appearance in MetroForm?

VB: How to customize the ControlBox buttons appearance in MetroForm?

Reference link: https://help.syncfusion.com/windowsforms/metro-form/customization

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon