Use a Hyperlink

Problem

You want to add a hyperlink to a form that, when clicked, performs an action (such as launching Microsoft Internet Explorer and opening your company Web site).

Solution

Use the LinkLabel control.

Discussion

The LinkLabel control is a special type of label that can include hyperlinks. You define where the hyperlinks are and then handle the LinkClicked event to determine what action should be taken.

To create a hyperlink, add a LinkLabel control to the form, and then enter the full text. By default, all the text will be included in the link. To change the link text, find the LinkArea property in the Properties window and click the ellipsis (. . .) to launch a special editor that allows you to mark the hyperlink text by selecting ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.