Create a Hyperlink in VB 6.0

In this tutorial, we will create a hyperlink label in VB 6.0. I also created this tutorial in VB.NET using the LinkLabel Control but here in VB 6.0 there is no shortcut control for this. Now, let's start this tutorial! 1.Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open Microsoft Visual Basic 6.0, click Choose Standard EXE, and click Open. 2. Next, add only one Label named Label1 and labeled it as "Click this to go to Sourcecodester Website". You must design your interface like this: link 3. Go to Project Menu and click References. Add reference 4. Find and Check Microsoft Internet Controls and click OK. links 5. Now, put this code in your code tab.
  1. Private Sub Form_Load()
  2. Label1.FontBold = True
  3. Label1.FontUnderline = True
  4. Label1.ForeColor = vbBlue
  5.  
  6. End Sub
  7.  
  8. Private Sub Label1_Click()
  9. Dim Ie As New InternetExplorer
  10. Ie.Visible = True
  11. Ie.Navigate "http://www.sourcecodester.com/"
  12. End Sub

Explanation:

In our Load Event of our form, we make our Label1 to have a Bold Text, Underlined, and have a color blue to make a hyperlink image. Now, in clicking the Label, we initialized or instantiate variable ie as an InternetExplorer. InternetExplorer is a part of the Microsoft Internet Controls Reference. We make this visible, and when clicking the Label it will navigate to www.sourcecodester.com.

Output:

outputoutput Download the source code and try it! :) For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below and hire me. Best Regards, Engr. Lyndon R. Bermoy IT Instructor/System Developer/Android Developer STI College - Surigao City Mobile: 09488225971 E-mail:[email protected] Follow and add me in my Facebook Account: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment