In this article I will explain with an example, how to open browser on link click in
Windows Forms (WinForms) application using C# and VB.Net.
Form Design
The following form consists of:
LinkLabel – This LinkLabel control will open Chrome browser with specified URL when clicked.
Using LinkLabel in C# and VB.Net
The following event handler is raised when the LinkLabel button is clicked.
Inside the
Click event handler, the
Start function of
Process class is called which opens
Chrome browser and instructs it to open
www.aspsnippets.com.
C#
private void lnkURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("Chrome.exe", "https://www.aspsnippets.com");
}
VB.Net
Private Sub lnkURL_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lnkURL.LinkClicked
Process.Start("Chrome.exe", "https://www.aspsnippets.com")
End Sub
Screenshot
Downloads