Windows Forms: Tag Control in C#

This post shows you How to create tags Windows Forms in C# .NET

TagListControl is a control of the FerretLib.WinForms library that helps you create the winform tag control.

To play demo you can create a new windows forms application, next enter your project name is "TagDemo" and then click OK button.

You should install the FerretLib.WinForms library from nuget by right-clicking on your project select Manage NuGet Packages -> Search FerretLib.WinForms -> Install.

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.

Dragging the tag control from the visual studio toolbox to your windows form application, then you can design a simple form as shown below.

tag control

Add the Form Load event handler to your form as the following c# code.

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;
}

You can create a list of string, then add datasource to the TagListControl.

VIDEO TUTORIAL