LinkLabel

The LinkLabel control allows you to add a short line of text on the form, as well as select all or part of the text to create a hyperlink to a web page or an object in the project.

Like the Label control, the LinkLabel displays text with the added capability of hyperlinks and the setting of link colours.

Properties

Key properties of LinkLabel include:

  • Content. The text to be displayed. For example, the text to be linked to a web page or file.
  • Font. Font (Family, Size, Style and Weight) characteristics can be set for the displayed text.
  • LinkArea. Sets the are of the text that is to be hyperlinked. This can be all or part of the whole text.
  • LinkColor / VisitedLinkColor / ActiveLink Color. These properties set the corresponding colour of the link when it is unselected, visited or activated.
  • LinkClicked. Determines the behaviour when the link text is selected.

Events

Events can be configured for the LinkLabel to specify the behaviour of the control. For example, an action can be configured to occur when a user clicks the link label using the Click event property.

For information on configuring events and other components of the design using a script, see: Working with Scripts.

Adding a LinkLabel

LinkLabels can be used to display a single link, or multiple hyperlinks using the Links property to provide a collection of links.

When you drag a LinkLabelcontrol to a form, it will appear in the default colour with the name text displayed.

The Properties for the LinkLabel can be configured to specify the link and format details.

Data can be specified for each link using the LinkData property for each LinkLabel.Link object. The LinkData property stores the location of the website to link to, or the file to display in a web control.

Information on the Properties and Events for the LinkLabel control can be found at the link to Microsoft® Documentation.