LinkArea Structure

 

Represents an area within a LinkLabel control that represents a hyperlink within the control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<Sealed>]
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(LinkArea.LinkAreaConverter))>]
type LinkArea = struct end

NameDescription
System_CAPS_pubmethodLinkArea(Int32, Int32)

Initializes a new instance of the LinkArea class.

NameDescription
System_CAPS_pubpropertyIsEmpty

Gets a value indicating whether the LinkArea is empty.

System_CAPS_pubpropertyLength

Gets or sets the number of characters in the link area.

System_CAPS_pubpropertyStart

Gets or sets the starting location of the link area within the text of the LinkLabel.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether this LinkArea is equal to the specified object.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the fully qualified type name of this instance.(Overrides ValueType.ToString().)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(LinkArea, LinkArea)

Returns a value indicating whether two instances of the LinkArea class are equal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(LinkArea, LinkArea)

Returns a value indicating whether two instances of the LinkArea class are not equal.

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 LinkArea that defines the location of the hyperlink within the control's text. When a hyperlink is specified using the LinkArea 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 LinkArea 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 LinkArea 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 LinkArea 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.

No code example is currently available or this language may not be supported.

.NET Framework
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.

Return to top
Show: