Siticone LinkedLabel
The SiticoneLinkedLabel is an enhanced Windows Forms LinkLabel that is optimized for modern UI design.
It features forced transparency support, high-quality rendering, and a comprehensive designer suite for managing links and visual themes.
Appearance & Behavior
Properties controlling the visual style, interaction mode, and color states of the links.
| Property | Type | Description & Usage Example |
|---|---|---|
LinkColor |
Color | lnk.LinkColor = Color.DodgerBlue; The color of the link text in its normal, unvisited state. |
ActiveLinkColor |
Color | lnk.ActiveLinkColor = Color.Red; The color of the link while it is being clicked (mouse down). |
VisitedLinkColor |
Color | lnk.VisitedLinkColor = Color.Purple; The color of the link after it has been visited. |
LinkBehavior |
LinkBehavior |
lnk.LinkBehavior = LinkBehavior.HoverUnderline;
Controls when the underline appears. Options: SystemDefault, AlwaysUnderline, HoverUnderline, NeverUnderline.
|
BackColor |
Color |
/* Read-Only */
Automatically set to Color.Transparent to ensure correct rendering over background images or gradients.
|
Link Management
Define which parts of the text are clickable and associate data with them.
| Property | Type | Description |
|---|---|---|
Text |
string | The full text displayed by the control. |
LinkArea |
LinkArea | lnk.LinkArea = new LinkArea(0, 5); Defines a single link range within the text (Start Index, Length). |
Links |
LinkCollection |
A collection allowing multiple distinct links within the same text. Use Links.Add() to populate.
|
Designer & Smart Tags
The SiticoneLinkedLabel includes advanced design-time features accessible via the Visual Studio Designer Smart Tag menu.
| Feature | Description |
|---|---|
Theme Presets |
Instantly apply color schemes via the Smart Tag menu:
|
Settings Clipboard |
Copy Settings: Copies visual properties (Font, Colors, Behavior) to an internal clipboard. Paste Settings: Applies the copied styles to another SiticoneLinkedLabel instance. |
Detailed Usage Examples
Example 1: Basic Web Link
A simple implementation where the entire text acts as a hyperlink to a webpage.
private void InitializeLink()
{
var lnk = new SiticoneLinkedLabel();
lnk.Text = "Visit our Website";
lnk.LinkBehavior = LinkBehavior.HoverUnderline;
// Add a link covering the entire text
lnk.Links.Add(0, lnk.Text.Length, "https://www.google.com");
lnk.LinkClicked += Lnk_LinkClicked;
this.Controls.Add(lnk);
}
private void Lnk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
// Open the URL stored in LinkData
lnk.LinkVisited = true;
System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
}
Example 2: Multiple Links in One Label
Creating a "Terms and Privacy" footer with two distinct clickable areas within a single label control.
private void SetupFooterLinks()
{
var footer = new SiticoneLinkedLabel();
footer.Text = "By signing up, you agree to our Terms of Service and Privacy Policy.";
footer.AutoSize = true;
// Define the "Terms of Service" link
footer.Links.Add(32, 16, "terms");
// Define the "Privacy Policy" link
footer.Links.Add(53, 14, "privacy");
footer.LinkClicked += (s, e) =>
{
string target = e.Link.LinkData as string;
if (target == "terms")
MessageBox.Show("Opening Terms...");
else if (target == "privacy")
MessageBox.Show("Opening Privacy...");
};
this.Controls.Add(footer);
}
Example 3: Internal Form Navigation
Using the LinkedLabel to navigate between forms within the application, acting as a lightweight button.
private void SetupNavigation()
{
var navLink = new SiticoneLinkedLabel();
navLink.Text = "Forgot Password?";
navLink.LinkColor = Color.DimGray;
navLink.ActiveLinkColor = Color.Black;
navLink.LinkClicked += (s, e) =>
{
var resetForm = new ResetPasswordForm();
resetForm.ShowDialog();
};
this.Controls.Add(navLink);
}
Example 4: Command Action Link
Using a link to execute a command, such as clearing a form, with custom styling to mimic a secondary action button.
private void SetupClearAction()
{
var cmdLink = new SiticoneLinkedLabel();
cmdLink.Text = "Clear All Fields";
// Style as a subtle action
cmdLink.LinkColor = Color.Crimson;
cmdLink.LinkBehavior = LinkBehavior.NeverUnderline;
cmdLink.Font = new Font("Segoe UI", 9f, FontStyle.Regular);
cmdLink.LinkClicked += (s, e) =>
{
txtUsername.Clear();
txtPassword.Clear();
txtEmail.Clear();
};
this.Controls.Add(cmdLink);
}