Imports System.Windows.Forms
public class LinkLabelAction
public Shared Sub Main
Application.Run(New FrmLinkLabel)
End Sub
End class
Public Class FrmLinkLabel
Inherits Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
' linklabels to C: drive, www.deitel.com and Notepad
Friend WithEvents lnklblCDrive As LinkLabel
Friend WithEvents lnklblDeitel As LinkLabel
Friend WithEvents lnklblNotepad As LinkLabel
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lnklblNotepad = New LinkLabel()
Me.lnklblCDrive = New LinkLabel()
Me.lnklblDeitel = New LinkLabel()
Me.SuspendLayout()
'
'lnklblNotepad
'
Me.lnklblNotepad.Location = New System.Drawing.Point(72, 112)
Me.lnklblNotepad.Name = "lnklblNotepad"
Me.lnklblNotepad.Size = New System.Drawing.Size(128, 23)
Me.lnklblNotepad.TabIndex = 2
Me.lnklblNotepad.TabStop = True
Me.lnklblNotepad.Text = "Click to run Notepad"
'
'lnklblCDrive
'
Me.lnklblCDrive.Location = New System.Drawing.Point(72, 16)
Me.lnklblCDrive.Name = "lnklblCDrive"
Me.lnklblCDrive.TabIndex = 0
Me.lnklblCDrive.TabStop = True
Me.lnklblCDrive.Text = "Click to browse C:\"
'
'lnklblDeitel
'
Me.lnklblDeitel.Location = New System.Drawing.Point(72, 64)
Me.lnklblDeitel.Name = "lnklblDeitel"
Me.lnklblDeitel.Size = New System.Drawing.Size(152, 23)
Me.lnklblDeitel.TabIndex = 1
Me.lnklblDeitel.TabStop = True
Me.lnklblDeitel.Text = "Click to visit www.java2java.com"
'
'FrmLinkLabel
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(264, 149)
Me.Controls.AddRange(New Control() {Me.lnklblNotepad, Me.lnklblDeitel, Me.lnklblCDrive})
Me.Name = "FrmLinkLabel"
Me.Text = "LinkLabelTest"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub lnklblCDrive_LinkClicked _
(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.LinkLabelLinkClickedEventArgs) _
Handles lnklblCDrive.LinkClicked
lnklblCDrive.LinkVisited = True
System.Diagnostics.Process.Start("C:\")
End Sub
Private Sub lnklblDeitel_LinkClicked _
(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.LinkLabelLinkClickedEventArgs) _
Handles lnklblDeitel.LinkClicked
lnklblDeitel.LinkVisited = True
System.Diagnostics.Process.Start("IExplore", "http://www.java2java.com")
End Sub ' lnklblDeitel
' run application Notepad
Private Sub lnklblNotepad_LinkClicked _
(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.LinkLabelLinkClickedEventArgs) _
Handles lnklblNotepad.LinkClicked
lnklblNotepad.LinkVisited = True
System.Diagnostics.Process.Start("notepad")
End Sub
End Class
|