How to use TagListControl in C#
By FoxLearn 7/19/2024 2:37:06 AM 11.39K
TagListControl is a control of the FerretLib.WinForms library that helps you create the winform tag control.
The "TagList" control is designed to display and manage tag lists typically used in contexts such as blog posts. It provides functionality for both displaying existing tags and editing them.
This control is useful for applications where categorization or labeling of content through tags is a core feature, allowing users to easily add, remove, and modify tags associated with items like blog posts or other similar content types.
How to use TagListControl in C#
Open your Visual Studio, then create a new Windows Forms application, then enter your project name is "TagDemo" and click OK button.
You need to add the FerretLib.WinForms library to your project. You can do this by downloading the library from the FerretLib GitHub repository or by using NuGet Package Manager to install it.
If you want to install the FerretLib.WinForms library from nuget. You can right click on your project select Manage NuGet Packages -> Search FerretLib.WinForms -> Install it.
Next, You need to add the FerretLib.WinForms to your toolbox, then drag and drop the tag control to your form.
TagList is a control intended for displaying and editing tag lists as commonly used for things like blog posts.
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 is an alternative to the ColorDialog for choosing colours based on ARGB values
You can see more details FerretLib.WinForms at GitHub.
Drag and drop the tag control from your Visual Studio toolbox to your windows form application, then you can design a simple form as shown below.
Here's a simple example demonstrating how to create a tag using FerretLib.WinForms in a C# Windows Forms application
Adding a 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
- How to Print Text in a Windows Form Application Using C#
- How to fill ComboBox and DataGridView automatically in C#
- How to Read text file and Sort list in C#
- How to pass ListView row data into another Form in C#
- How to read and write to text file in C#
- How to make a Countdown Timer in C#
- How to Display selected Row from DataGridView to TextBox in C#
- How to Get all Forms and Open Form with Form Name in C#