Windows Forms: Metro Message Box in C#

Create Metro MessageBox in C# using Metro Framework, Modern UI

Step 1Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "MetroMessageBoxDemo" and then click OK

metro messageboxStep 2: Right click on your project select Manage NuGet Packages -> Search metro framework -> Install

install metro frameworkStep 3: Design your metro form as below

metro ui design

Step 4: Add code to handle your form

using System;
using System.Windows.Forms;

namespace MetroMessageBoxDemo
{
    public partial class Form1 : MetroFramework.Forms.MetroForm
    {
        public Form1()
        {
            InitializeComponent();
        }

        //OK message box
        private void metroTile1_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "OK", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        //Yes/No message box
        private void metroTile3_Click(object sender, EventArgs e)
        {
            if (MetroFramework.MetroMessageBox.Show(this, "Yes/No", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                //Do something
            }
        }

        //YesNo/Cancel message box
        private void metroTile2_Click(object sender, EventArgs e)
        {
            if (MetroFramework.MetroMessageBox.Show(this, "YesNo/Cancel", "Message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                //Do something
            }
        }

        //Error message box
        private void metroTile4_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "Error", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        //Warning message box
        private void metroTile5_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "Warning", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        //Hand message box
        private void metroTile6_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "Hand", "Message", MessageBoxButtons.OK, MessageBoxIcon.Hand);
        }

        //Stop message box
        private void metroTile7_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "Stop", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
        }

        //OK message box
        private void metroTile8_Click(object sender, EventArgs e)
        {
            MetroFramework.MetroMessageBox.Show(this, "None");
        }
    }
}

VIDEO TUTORIALS