How to create a Metro Live Tiles in C#
By FoxLearn 10/5/2024 3:35:23 AM 11.53K
Creating Metro Live Tiles using the Metro Framework in C# involves a few key steps.
Below is a guide to help you create Live Tiles for a Windows application using the Metro UI style.
Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "MetroLiveTitle" and then click OK.
Next, Right click on your project select Manage NuGet Packages -> Search metro framework -> Install
Drag and drop the MetroTile
control from the Visual Studio Toolbox onto your form designer, then design your metro form as shown below.
You need to add a timer control to your metro form, then modify your code to handle metro live title as shown below.
using System; using System.Drawing; namespace MetroLiveTile { public partial class Form1 : MetroFramework.Forms.MetroForm { public Form1() { InitializeComponent(); } //Change image, background private void timer1_Tick(object sender, EventArgs e) { if (metroTile1.BackColor == Color.LightSkyBlue) { metroTile1.Text = "FoxLearn"; metroTile1.BackColor = Color.ForestGreen; metroTile1.UseTileImage = false; } else { metroTile1.Text = "Skype"; metroTile1.BackColor = Color.LightSkyBlue; metroTile1.UseTileImage = true; metroTile1.Refresh(); } // if (metroTile7.BackColor == Color.DeepSkyBlue) { metroTile7.Text = "FoxLearn"; metroTile7.BackColor = Color.Orange; } else { metroTile7.Text = "Skype"; metroTile7.BackColor = Color.DeepSkyBlue; metroTile7.Refresh(); } } private void Form1_Load(object sender, EventArgs e) { //Start your timer timer1.Start(); } } }
VIDEO TUTORIAL
- How to use Modern UI Metro Framework in C#
- How to Create CPU and Memory Monitor using Metro Modern UI in C#
- How to Create a Metro Modern Flat UI Dashboard in C#
- How to Download and Install Metro Framework
- How To Use Metro Framework Metro Style Manager in C#
- How to Create a Modern Windows 8 UI with the Metro Framework in C#
- How to create a Metro Wait Form in C#
- How to create a Metro Message Box in C#
Categories
Popular Posts
11 Things You Didn't Know About Cloudflare
12/19/2024