-
Apr 22nd, 2006, 06:50 AM
#1
Thread Starter
Just Married
How to Link any label or command button to any website
Hi all
I want to link a label or command button to a particular web page
What is the method for it?
Can any one send me it’s coding.
Miss I want that when I click on any command button at my form then it open the website vbforums.com.
Help me
Thanks
-
Apr 22nd, 2006, 07:25 AM
#2
Re: How to Link any label or command button to any website
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_NORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Open", "http://www.vbforums.com", 0&, 0&, SW_NORMAL
End Sub
-
Apr 22nd, 2006, 07:43 AM
#3
Thread Starter
Just Married
Re: How to Link any label or command button to any website
thanks
it is workingvery well
-
Apr 22nd, 2006, 07:44 AM
#4
Re: How to Link any label or command button to any website
Don't forget to mark this thread resolved
-
Apr 22nd, 2006, 10:49 AM
#5
Hyperactive Member
Re: How to Link any label or command button to any website
Hi all, hi Bush
BTW: I would like about something to ask
This function with these parameters be required for each page www?
It is possible in order to replace "http://www.vbforums.com" any written in textbox adress or chosen the adress in Combo?
Thanks in advance
I know, I know, my English is bad, sorry .....
-
Apr 22nd, 2006, 10:53 AM
#6
Re: How to Link any label or command button to any website
Just replace the address with a string variable, e.g.:
VB Code:
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Open", Text1.Text, 0&, 0&, SW_NORMAL
ShellExecute Me.hwnd, "Open", Combo1.List(Combo1.ListIndex), 0&, 0&, SW_NORMAL
End Sub
-
Apr 22nd, 2006, 11:12 AM
#7
Hyperactive Member
Re: How to Link any label or command button to any website
Here a code 4 u Tamgovb! It's a simple code to extent Mr Bush explaination. Try to use and modified the code. You'll find it useful and exciting
VB Code:
Dim address As String
Private Sub Command1_Click()
address = Combo1
ShellExecute Me.hwnd, "Open", address, 0&, 0&, SW_NORMAL
End Sub
Private Sub Form_Load()
Dim VbForum, Yahoo As String
VbForum = "www.vbforum.com"
Yahoo = "www.yahoo.com"
Combo1.AddItem VbForum
Combo1.AddItem Yahoo
End Sub
-
Apr 22nd, 2006, 11:13 AM
#8
Hyperactive Member
Re: How to Link any label or command button to any website
Thanks for reply Bush. Always I can rely on you
I know, I know, my English is bad, sorry .....
-
Apr 22nd, 2006, 11:21 AM
#9
Hyperactive Member
Re: How to Link any label or command button to any website
Yeah, thanks Bearnerd, thanks very much, I will practice now, it with certainty will be useful.
I greet
I know, I know, my English is bad, sorry .....
-
Jun 30th, 2014, 06:02 AM
#10
New Member
Re: How to Link any label or command button to any website
I know this forum was created many of years ago, but I came across the issue today since I'm a beginner.
I searched for many of hours to finally find the proper & easiest way to link buttons up or linklabels up with URL's.
Since there was no videos out there showing how to do it, I made one & here is the link for it https://www.youtube.com/watch?v=zyIVb9D8UGU
-
Jun 30th, 2014, 04:12 PM
#11
Re: How to Link any label or command button to any website
How does this simple ordinary run-of-the-mill thread get a five star rating and why?
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jul 1st, 2014, 01:34 AM
#12
Re: How to Link any label or command button to any website
keep in mind that sometimes simply using Shell may be preffered if you're giong to release it to public,
as for some reason antiviruses seem to hate shell executes.
Code:
Public Function LoadURL(url as String)
Shell("explorer http://" & url , vbNormalFocus)
End Function
'usage example: LoadURL("www.google.com")
So make your pick
Last edited by stum; Jul 1st, 2014 at 01:38 AM.
-
Jul 1st, 2014, 02:14 AM
#13
Re: How to Link any label or command button to any website
Originally Posted by jmsrickland
How does this simple ordinary run-of-the-mill thread get a five star rating and why?
Same reason this one did, probably.
http://www.vbforums.com/showthread.p...a-MSHFlex-grid
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Jul 1st, 2014, 02:30 AM
#14
Re: How to Link any label or command button to any website
Originally Posted by visualbasictutorials
I know this forum was created many of years ago, but I came across the issue today since I'm a beginner.
Thanks for trying to help but you are using VB.NET and this is for VB6.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 1st, 2014, 01:42 PM
#15
Re: How to Link any label or command button to any website
Originally Posted by ColinE66
Yep, that's what I thought. I did that just to see of an OP can give his thread a 5-star rating
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jul 1st, 2014, 02:20 PM
#16
Re: How to Link any label or command button to any website
I realised that was possible when I noticed that salsa's threads always got 5 stars!
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Jul 1st, 2014, 02:44 PM
#17
Re: How to Link any label or command button to any website
I've always wondered how so many threads got a 5 star. Now some are worthy but a lot I just can't see it. OPs should not be allowed to rate their own threads - the site should change that
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jul 2nd, 2014, 01:13 PM
#18
Re: How to Link any label or command button to any website
Meh, not so sure about that. Most threads are unrated period. This suggests that the ONLY people who tend to rate threads are the OP's of those threads. Remove the functionality from them and it won't get used at all! If you see a 5* thread that you think should be lower you could always balance it out with a rating of your own
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|