O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required