• We just launched and are currently in beta. Join us as we build and grow the community.

LinkLabel Control in VB.NET

dootdoot

Gig Platform Expert
Divine
D Rep
0
0
0
Rep
0
D Vouches
0
0
0
Vouches
0
Posts
181
Likes
69
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
We often see hyperlinks along the way in our websites, forms, etc. Same here in vb.net that we can also use this control to link to other websites through the use of linklabel. LinkLabel controls enable a user to hyperlink to a URL that points to either the Web or the local directory system. The idea is to put the email address or web URL into the Text property of a LinkLabel component, then when the label is clicked, the LinkClicked event is triggered. There are well over a hundred methods and objects available for the LinkLabel object including properties to handle everything you might want to do with a link like changing the color, text, position, how it behaves when you click it.

So, now let's start this tutorial with this LinkLabel!

1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.

2. Next, add only one LinkLabel named LinkLabel1 and put a text on it with "Click this to open the website of SourceCodester" Design your layout like this one below:

linkdesign.png


3. Then, click the LinkLabel control and you will see that it will have a LinkClicked event. The idea of this is to have the label linked to the URL of a website or to a local resources. Put this code below:
  1. Private

    Sub

    LinkLabel1_LinkClicked(

    ByVal

    sender As

    System.

    Object

    , ByVal

    e As

    System.

    Windows

    .

    Forms

    .

    LinkLabelLinkClickedEventArgs

    )

    Handles

    LinkLabel1.

    LinkClicked
  2. System.

    Diagnostics

    .

    Process

    .

    Start

    (

    "www.sourcecodester.com"

    )
  3. End

    Sub

Explanation:

We have a syntax of System.

Diagnostics

.

Process

.

StartStarts

that starts a process resource by specifying the name of a document, URL of a website, or application file and associates the resource with a new Process component. We put inside the www.sourcecodester.com to indicate that it will go to the said website.

Output:

When you click the button it will go to the inputted website.

labeloutput.png


Download the source code below and try it! :)

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.

Best Regards,

Engr. Lyndon R. Bermoy

IT Instructor/System Developer/Android Developer

Mobile: 09079373999

Telephone: 826-9296

E-mail:[email protected]

Visit and like my page on Facebook at: Bermz ISware Solutions

Subscribe at my YouTube Channel at: SerBermz


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,341

323,350

Top