Skip to main content
Version: 4.1

LinkLabelExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the LinkLabel class.

public class LinkLabelExtensions

Methods

Static member ActiveLinkColor<TLinkLabel>(linkLabel, activeLinkColor)

Sets the ActiveLinkColor property of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label for which to set the ActiveLinkColor property.
activeLinkColorColorThe 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);

Static member DisabledLinkColor<TLinkLabel>(linkLabel, disabledLinkColor)

Sets the DisabledLinkColor property of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label for which to set the DisabledLinkColor property.
disabledLinkColorColorThe 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);

Static member LinkArea<TLinkLabel>(linkLabel, linkArea)

Sets the LinkArea property of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label for which to set the LinkArea property.
linkAreaLinkAreaThe 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));

Static member LinkBehavior<TLinkLabel>(linkLabel, linkBehavior)

Sets the LinkBehavior property of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label for which to set the LinkBehavior property.
linkBehaviorLinkBehaviorThe 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);

Static member LinkColor<TLinkLabel>(linkLabel, linkColor)

Sets the LinkColor property of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label for which to set the LinkColor property.
linkColorColorThe 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);

Static member OnLinkClicked<TLinkLabel>(linkLabel, action)

Attaches an event handler for the LinkClicked event of the specified LinkLabel.

ParameterTypeDescription
TLinkLabelThe type of the link label, must inherit from LinkLabel.
linkLabelTLinkLabelThe link label to attach the event handler to.
actionAction<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!");
});