Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display 'links' inside a windows form label 1

Status
Not open for further replies.

warrickvdb

Programmer
Oct 7, 2003
13
ZA
I am building a windows desktop app and am having to display some text inside a label. I need to put a link on some of the words in the label so that the user can click on the words and a popup window will appear with a definition of the words.

How can I put that link their?
 
Use a LinkLabel.

This example places a link within the text of the label and launches IE when clicked.
Code:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

    With LinkLabel1

        .Text = "Click here to go to Microsoft"

        .Links.Add(6, 4, "[URL unfurl="true"]www.microsoft.com")[/URL]

    End With

End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked

    System.Diagnostics.Process.Start(e.Link.LinkData.ToString)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top