)
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 hide icons in the WinForms MetroForm caption?

Platform: WinForms |
Control: MetroForm |
Published Date: October 28, 2015 |
Last Revised Date: January 6, 2020

Hide the form icon

You can hide the form icon from your application without hiding the icon in the Taskbar by using the CaptionImages support in MetroForm. Follow the given steps to achieve this.

  1. Create a caption image based on the MetroForm caption color.
  2. Add it to the caption images collection and specify its location as it overlaps the MetroForm icon.

C#

//Sets the borderColor.
this.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
//Sets the CaptionBarColor.
this.CaptionBarColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
//Sets the CaptionButton color.
this.CaptionButtonColor = System.Drawing.Color.White;
//Sets the Caption Forecolor.
this.CaptionForeColor = System.Drawing.Color.White;
//Sets the BackColor of the Caption Image.
captionImage1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
//Sets the caption image location.
captionImage1.Location = new System.Drawing.Point(0, 0);
//Caption image name.
captionImage1.Name = "CaptionImage1";
//Specifies the caption image size.
captionImage1.Size = new System.Drawing.Size(30, 30);
//Adds the CaptionImage to its collection.
this.CaptionImages.Add(captionImage1);

VB

'Sets the borderColor.
Me.BorderColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(17))))), (CInt(Fix((CByte(158))))), (CInt(Fix((CByte(218))))))
'Sets the CaptionBarColor.
Me.CaptionBarColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(17))))), (CInt(Fix((CByte(158))))), (CInt(Fix((CByte(218))))))
'Sets the CaptionButton color.
Me.CaptionButtonColor = System.Drawing.Color.White
'Sets the caption Forecolor.
Me.CaptionForeColor = System.Drawing.Color.White
'Sets the BackColor of the Caption Image.
captionImage1.BackColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(17))))), (CInt(Fix((CByte(158))))), (CInt(Fix((CByte(218))))))
'Sets the caption image location.
captionImage1.Location = New System.Drawing.Point(0, 0)
'Caption image name.
captionImage1.Name = "CaptionImage1"
'Specifies the caption image size.
captionImage1.Size = New System.Drawing.Size(30, 30)
'Adds the CaptionImage to its collection.
Me.CaptionImages.Add(captionImage1)

 

Form icon hidden in application

Figure 1: Form Icon hidden in Application

Samples:

C#: MetroForm_TaskBarImage_C#

VB: MetroForm_TaskBarImage_VB

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