Articles in this section
Category / Section

How to customize multiple WinForms MetroForm loaded in application?

1 min read

Customize multiple MetroForm loaded in application

In an Application, user will have multiple number of MetroForm and it will be difficult for users, to do the modifications in each of the MetroForm used in it. Hence user can create Custom Form inherited from MetroForm and use it in Forms loaded in application. This will help user to perform modifications in one place and make changes reflected in all of the used MetroForm.

Following code examples demonstrates the same.

C#

/// <summary>
/// Class that inherits the properties of MetroForm
/// </summary>
public class MetroFormAdv : MetroForm
{       
      public MetroFormAdv() { }
      InitializeComponent();
      //Properties of MetroForm
      this.CaptionBarColor = Color.FromArgb(17, 158, 218);
      this.CaptionBarHeight = 26;
      this.CaptionAlign = HorizontalAlignment.Left;
      this.CaptionFont = new Font("Times New Roman", 12, FontStyle.Italic);
      this.StartPosition = FormStartPosition.CenterScreen;
}

VB

''' <summary>
''' Class that inherits the properties of MetroForm
''' </summary>
Public Class MetroFormAdv
      Inherits MetroForm
      Public Sub New()
      InitializeComponent()
      'Properties of MetroForm
      Me.CaptionBarColor = Color.FromArgb(17, 158, 218)
      Me.CaptionBarHeight = 26
      Me.CaptionAlign = HorizontalAlignment.Left
      Me.CaptionFont = New Font("Times New Roman", 12, FontStyle.Italic)
      Me.StartPosition = FormStartPosition.CenterScreen
End Sub

Customize muliple MetroForm loaded in application with image

Figure 1. customize multiple MetroForm loaded in application with image

Samples:

C#: How to customize multiple MetroForm loaded in application easily?

VB: How to customize multiple MetroForm loaded in application easily?

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