Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/display-a-web-page-from-a-wf-linklabel-control-visual-basic.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.7 KiB

title, ms.date, dev_langs, f1_keywords, helpviewer_keywords, ms.assetid
title ms.date dev_langs f1_keywords helpviewer_keywords ms.assetid
Display Web Page from LinkLabel Control (Visual Basic) 03/30/2017
vb
LinkLabel1_LinkClicked
examples [Windows Forms], LinkLabel control
Web pages [Windows Forms], displaying
linking [Windows Forms], to Web pages from forms
Windows Forms, linking to Web pages
LinkLabel control [Windows Forms], examples
477a7398-5971-4de3-b24c-f49f32bdb28a

How to: Display a Web Page from a Windows Forms LinkLabel Control (Visual Basic)

This example displays a Web page in the default browser when a user clicks a Windows Forms xref:System.Windows.Forms.LinkLabel control.

Example

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e _  
As System.EventArgs) Handles MyBase.Load  
    LinkLabel1.Text = "Click here to get more info."  
    LinkLabel1.Links.Add(6, 4, "www.microsoft.com")  
End Sub  
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal _  
e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles _  
LinkLabel1.LinkClicked  
    System.Diagnostics.Process.Start(e.Link.LinkData.ToString())  
End Sub  

Compiling the Code

This example requires:

.NET Framework Security

The call to the xref:System.Diagnostics.Process.Start%2A method requires full trust. For more information, see xref:System.Security.SecurityException.

See also