How to use Winforms Modern UI
This is my first tutorial on how to use Winforms Modern UI Metro Framework. On this tutorial we will be using Visual Studio 2010 and C#. Winforms Modern UI Metro Framework can also be used in Visual Studio 2012 and 2013, the .net framework requirement is 2.0 and above. So lets start this tutorial on how to use Winforms Modern UI Metro Framework.Before we can create new project with winforms modern ui, we need to grab a copy winforms modern ui metro framework source code from Github. Just click here to open Github. Once you are in Github you have three option, if you have Github account you fork the source. You can also clone it in your desktop and lastly you can download it as zip file.
Once we have a copy of winforms modern ui metro framework source code we need to compile it. The easiest way to compile it is by opening the project in Visual Studio. After compiling we need the following DLLs MetroFramework.dll, MetroFramework.Fonts.dll and MetroFramework.Design.dll. Just place it one folder for easy access.
Lets now create a new Windows Forms Application in Visual Studio 2010 and name it as MetroSample
Right click on toolbox and add new tab and type MetroFramework. Right click again on the MetroFramework tab and select `Choose items…`
Click browse and locate the folder from where you place MetroFramework, MetroFramework.Fonts and MetroFramework.Design DLLs and select MetroFramework
All of the available controls in MetroFramework will be display on the toolbox.
Lets now add MetroFramework.dll, MetroFramework.Fonts.dll and MetroFramework.Design.dll as a reference on our project. Right click in references then choose Add References
Click browse and locate the folder from where you place MetroFramework, MetroFramework.Fonts and MetroFramework.Design DLLs and select the three DLL’s
Now our project is properly setup and can now use Winforms Modern UI Metro Framework. Open up the code of Form1 and paste the code below :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using MetroFramework.Forms; namespace MetroSample { public partial class Form1 : MetroForm { public Form1() { InitializeComponent(); } } } |
0 comments:
Post a Comment