LinkLabelExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the LinkLabel class.
- C#
- VB.NET
public class LinkLabelExtensions
Public Class LinkLabelExtensions
Methods
ActiveLinkColor<TLinkLabel>(linkLabel, activeLinkColor)
Sets the ActiveLinkColor property of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label for which to set the ActiveLinkColor property. |
| activeLinkColor | Color | The Color to set for active links. |
Returns: TLinkLabel. The modified link label with the updated ActiveLinkColor property.
This method allows you to specify the color of active links in the link label.
myLinkLabel.ActiveLinkColor(Color.Red);
DisabledLinkColor<TLinkLabel>(linkLabel, disabledLinkColor)
Sets the DisabledLinkColor property of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label for which to set the DisabledLinkColor property. |
| disabledLinkColor | Color | The Color to set for disabled links. |
Returns: TLinkLabel. The modified link label with the updated DisabledLinkColor property.
This method allows you to specify the color of disabled links in the link label.
myLinkLabel.DisabledLinkColor(Color.Gray);
LinkArea<TLinkLabel>(linkLabel, linkArea)
Sets the LinkArea property of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label for which to set the LinkArea property. |
| linkArea | LinkArea | The LinkArea to set for the link label. |
Returns: TLinkLabel. The modified link label with the updated LinkArea property.
This method allows you to specify the area of text that is treated as a link in the link label.
myLinkLabel.LinkArea(new LinkArea(0, 10));
LinkBehavior<TLinkLabel>(linkLabel, linkBehavior)
Sets the LinkBehavior property of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label for which to set the LinkBehavior property. |
| linkBehavior | LinkBehavior | The LinkBehavior to set for the link label. |
Returns: TLinkLabel. The modified link label with the updated LinkBehavior property.
This method allows you to specify the behavior of the link label, such as how the link is displayed when the mouse is over it.
myLinkLabel.LinkBehavior(LinkBehavior.SystemDefault);
LinkColor<TLinkLabel>(linkLabel, linkColor)
Sets the LinkColor property of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label for which to set the LinkColor property. |
| linkColor | Color | The Color to set for links. |
Returns: TLinkLabel. The modified link label with the updated LinkColor property.
This method allows you to specify the color of links in the link label.
myLinkLabel.LinkColor(Color.Blue);
OnLinkClicked<TLinkLabel>(linkLabel, action)
Attaches an event handler for the LinkClicked event of the specified LinkLabel.
| Parameter | Type | Description |
|---|---|---|
| TLinkLabel | The type of the link label, must inherit from LinkLabel. | |
| linkLabel | TLinkLabel | The link label to attach the event handler to. |
| action | Action<TLinkLabel, LinkLabelLinkClickedEventArgs> | An action to execute when a link is clicked. |
Returns: TLinkLabel. The modified link label with the attached LinkClicked event handler.
This method allows you to execute a custom action whenever a link in the link label is clicked.
myLinkLabel.OnLinkClicked((ll, args) =>
{
AlertBox.Show("Link clicked!");
});