VB.NET LinkLabel Control.
The VB.NET LinkLabel control is similiar to the label control, with the exception of hyperlinks. The LinkLabel control can display single or multiple hyperlinks. When the user clicks a hyperlink, the process can be started in th event.
Namespace: System::Windows::Forms
System.Windows.Forms (in system.windows.forms.dll)
Creating an new VB.NET Windows forms LinkLabel.
Dim linklabel As New LinkLabel
Assigning a AutoSize Value to the LinkLabel Control.
linklabel.AutoSize = False
Docking the VB.NET LinkLabel Control.
linklabel.Dock = DockStyle.Top
Assigning a text value to the VB.NET LinkLabel control.
linklabel.Text = "Link to Web Site"
Adding a VB.NET LinkLabel control to the form.
Me.Controls.Add(linklabel)
Creating a LinkClicked Event for the VB.NET LinkLabel control.
AddHandler linklabel.LinkClicked, AddressOf LinkLabel_LinkClicked
Responding to the VB.NET LinkLabel LinkClicked event.
Private Sub LinkLabel_LinkClicked(ByVal sender As Object, ByVal e As LinkLabelLinkClickedEventArgs)
MessageBox.Show("Link Clicked")
End Sub
|