LinkLabelExtensions

Wisej.Web.Markup.LinkLabelExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.0.0.0)

Adds fluent markup extension methods to the LinkLabel class.

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

The link label for which to set the ActiveLinkColor property.

activeLinkColor

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

The link label for which to set the DisabledLinkColor property.

disabledLinkColor

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

The link label for which to set the LinkArea property.

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

The link label for which to set the LinkBehavior property.

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

The link label for which to set the LinkColor property.

linkColor

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

The link label to attach the event handler to.

action

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!");
});

Last updated

Was this helpful?