Represents an area within a LinkLabel control that represents a hyperlink within the control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Determines whether this ValueType.Equals(Object).)is equal to the specified object.(Overrides
Returns the hash code for this instance.(Overrides ValueType.GetHashCode().)
Returns the fully qualified type name of this instance.(Overrides ValueType.ToString().)
There are two ways to add a hyperlink to the text of a LinkLabel control. You can access the Add method of the LinkLabel.LinkCollection class through the Links property of the LinkLabel to add multiple hyperlinks to the control's text. If you only need to add a single hyperlink to the text of the control, you can use the LinkArea property of the LinkLabel. This property accepts a that defines the location of the hyperlink within the control's text. When a hyperlink is specified using the property, the link area is then added to the LinkLabel.LinkCollection in the same manner as adding the link using the Add method of the LinkLabel.LinkCollection.
The Length property specifies the number of characters within the text of the LinkLabel to include in the link area. The Start property specifies the first character in the control text to include in the hyperlink. If you want to determine whether a specific is empty, you can use the IsEmpty property instead of checking the values of the Start and Length properties.
The following code example demonstrates using the LinkLabel class, with multiple sections defined, to display a label on a form. The example demonstrates setting the AutoSize, LinkBehavior, DisabledLinkColor, LinkColor, and VisitedLinkColor properties to customize the look of the LinkLabel. The first is specified using the LinkLabel.LinkArea property. Additional links are added to the LinkLabel using the LinkLabel.LinkCollection.Add method. The example handles the LinkClicked event by starting the Web browser for hyperlinks, and displaying a MessageBox for other links.
Available since 1.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.