Windows Forms: How To Use Metro Framework Metro Style Manager in C#
By FoxLearn 6/20/2017 9:49:46 PM 16.64K
How To Use Metro Style Manager in C# using Metro Framework, Modern UI
Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "MetroStyle" and then click OK
Step 2: Right click on your project select Manage NuGet Packages -> Search metro framework -> Install
If you don't see the metro framework in your toolbox, you can view How to download and install metro framework
Step 3: Design metro form as below
Step 4: Add code to handle your metro form as below
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MetroStyle { public partial class Form1 : MetroFramework.Forms.MetroForm { public Form1() { InitializeComponent(); //Set style manager this.StyleManager = metroStyleManager1; } private void mbTheme_SelectedIndexChanged(object sender, EventArgs e) { //Select metro theme switch (mbTheme.SelectedIndex) { case 0: metroStyleManager1.Theme = MetroFramework.MetroThemeStyle.Dark; break; case 1: metroStyleManager1.Theme = MetroFramework.MetroThemeStyle.Light; break; } } private void mbColor_SelectedIndexChanged(object sender, EventArgs e) { //Select metro color metroStyleManager1.Style = (MetroFramework.MetroColorStyle)Convert.ToInt32(mbColor.SelectedIndex); } private void Form1_Load(object sender, EventArgs e) { mbColor.SelectedIndex = 0; mbTheme.SelectedIndex = 0; } } }
VIDEO TUTORIALS
- How to create a Metro Message Box in C#
- How to use Metro Progress Bar in C#
- How to create a Metro Live Tiles in C#
- How to Create a Metro ListView in C#
- How to Create a Metro GridView in C#
- How to Create a Modern UI Login Form in C#
- How to Create a Metro TextBox in C#
- How to use Modern UI Metro Framework in C#
Categories
Popular Posts
Admin Tailwind CSS Admin Dashboard Template
11/18/2024
Regal Admin Dashboard Template
11/18/2024
Flat Able Admin Dashboard Template
11/18/2024
AdminKit Bootstrap 5 HTML5 UI Kits Template
11/17/2024