Windows Forms: Tag Control in C#

How to create tags windows forms in C#

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

c# tag controlStep 2: Right click on your project select Manage NuGet Packages -> Search FerretLib.WinForms -> Install

tag control c#

You need to add FerretLib.WinForms to your toolbox, then drag the tag control to your form

TagList A control intended for displaying and editing tag lists as commonly used for things like blog posts. 

taglist

ResourceFontLoader Helper class for loading fonts embedded as resources in your .exe Currently broken because of a .Net Framework bug which has been reported and gone unfixed since .Net 2.0 - do not count on this working any time soon

ColorPicker An alternative to the ColorDialog for choosing colours based on ARGB values

color picker

You can see more details FerretLib.WinForms at GitHub

Step 3: Design your form as below

tag control

Step 4: Add code to handle your form

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 TagDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //Init tags
            List<string> tags = new List<string>();
            tags.Add("C#");
            tags.Add("Windows Forms");
            tags.Add("WPF");
            tags.Add("WCF");
            tags.Add("ASP.NET");
            tags.AddRange(new string[] { "Web Services", "MVC", "Entity Framework" });
            tagListControl1.Tags = tags;
        }
    }
}

VIDEO TUTORIALS