Articles in this section
Category / Section

How to hide icons in the WinForms MetroForm caption?

1 min read

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

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied