Windows Forms: Create CPU & Memory Monitor using Metro Modern UI in C#
By FoxLearn 6/3/2017 6:12:34 PM 8.09K
How to Create CPU & Memory Monitor 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 "CPURAM" 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 your metro form as below
Step 4: Add Timer and PerformanceCounter to metro form, then add a tick event handler to timer
using System; namespace CPURAM { public partial class Form1 : MetroFramework.Forms.MetroForm { public Form1() { InitializeComponent(); } private void timer_Tick(object sender, EventArgs e) { float fcpu = pCPU.NextValue(); float fram = pRAM.NextValue(); //Set value to cpu and ram</span> metroProgressBarCPU.Value = (int)fcpu; metroProgressBarRAM.Value = (int)fram; //Update value to cpu and ram label</span> lblCPU.Text = string.Format("{0:0.00}%", fcpu); lblRAM.Text = string.Format("{0:0.00}%", fram); } private void Form1_Load(object sender, EventArgs e) { timer.Start(); } } }
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
Flat Able Admin Dashboard Template
11/18/2024
Regal Admin Dashboard Template
11/18/2024
Plus Admin Dashboard Template
11/18/2024
Admin Tailwind CSS Admin Dashboard Template
11/18/2024