User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 391,579 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,716 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 863 | Replies: 2
Reply
Join Date: Sep 2007
Posts: 69
Reputation: geetajlo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

How to link a button to an HTML page?

  #1  
Mar 10th, 2008
hi friends...
i want to link a buuton to an html page. i knx there is its control in the toolbox bt i don't know how to use it.. need help plzz
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 24
Reputation: suganzeni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
suganzeni suganzeni is offline Offline
Newbie Poster

Re: How to link a button to an HTML page?

  #2  
Mar 11th, 2008
Hi
In vb.net you having a tool named Link Label.
Use the link label to link a HTML Page to your form.

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal_
e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)_
Handles LinkLabel1.LinkClicked
System.Diagnostics.Process.Start("www.startvbdotnet.com")
'using the start method of system.diagnostics.process class
'process class gives access to local and remote processes
End Sub

Give your target like("c:\...") inside the System.Diagnostics.Process.Start() method.

For further clarification see the following link
http://www.startvbdotnet.com/controls/label.aspx
Last edited by suganzeni : Mar 11th, 2008 at 5:57 am.
Reply With Quote  
Join Date: Jan 2008
Posts: 20
Reputation: leokuz is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
leokuz leokuz is offline Offline
Newbie Poster

Re: How to link a button to an HTML page?

  #3  
Mar 12th, 2008
I can't go smarter than this (I'm no expert), but following worked for me:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Shell("C:\Program Files\Internet Explorer\iexplore.exe http://www.yourwebsite.com")

    End Sub


Change "iexplore.exe" and its directory to a browser of your choice.

Or else, you can do what "suganzeni" suggested but inside your button code. e.g.:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        System.Diagnostics.Process.Start("http://www.yourwebsite.com")

    End Sub
Last edited by leokuz : Mar 12th, 2008 at 2:52 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 10:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC