How to Download and Install Metro Framework

By FoxLearn 7/16/2024 8:37:52 AM   47.22K
How to download and install Metro Framework from Nuget or offline without using Visual Studio.

Metro Framework is a popular winforms ui framework free that helps you design an awesome metro modern UI, brings Windows 8 UI to .NET Windows Forms application.

Supported platforms: Windows XP SP1/SP2/SP3, Windows Vista, Windows 7/8/10

How to Download and Install Metro Framework in C#

Open your Visual Studio, then create New Project, by selecting Visual C# on the left, then Windows and then select Windows Forms Application. Enter your project name and then click OK button.

After completing the creation of the new project, you need to right click on your project, then select Manage NuGet Packages -> search metro framework -> install it on your project as shown below.

install metro framework

Additionally, you can download Metro Framework from its official GitHub repository: MetroModernUI. You can either download the source code or just the compiled DLL files.

After downloading Metro Framework, you can add it to your C# project by extracting the downloaded Metro Framework files, then you will find DLL files inside the extracted folder.

Next, Right-click on your project in Visual Studio, then Select "Add" > "Reference..." => Browse for the DLL files you extracted and add them to your project.

To create a simple metro ui, you can drag the MetroTitle controls from Visual Studio toolbox to your windows forms application, then you can layout your metro dashboard form as shown below.

metro dashboard

Once you've added the Metro Framework to your project, you need to make some modifications to use its components and styles.

Open your Form1 code behind, you need to change the base class of your form to MetroForm, then add your code to handle metro link click event as the following.

// metro ui form c#
public partial class Form1 : MetroFramework.Forms.MetroForm
{
    // metro ui c#
    public Form1()
    {
        InitializeComponent();
    }

   // c# metro message box
    private void metroLink2_Click(object sender, EventArgs e)
    {
        MetroFramework.MetroMessageBox.Show(this, "Next");
    }

    private void metroLink1_Click(object sender, EventArgs e)
    {
        MetroFramework.MetroMessageBox.Show(this, "Back");
    }
}

We simply display the metro message box when we click the back and next link button.

Build your project and run it. You should see the modern Metro-style UI in your Windows Forms application.

VIDEO TUTORIAL