I made a Command1 button in visual basic, I want to know how to make this button a shortcut key.
So that if I click it, it will open up the program I want.
For example, if I clicked a button labeled Firefox, it would open Firefox.
Could you enter the code required and explain it (only been doing VB6 for 3 days).
VB6 Shortcut button
Page 1 of 14 Replies - 916 Views - Last Post: 23 November 2009 - 02:41 PM
Replies To: VB6 Shortcut button
#3
Re: VB6 Shortcut button
Posted 21 November 2009 - 05:07 PM
I have:
That is all, but it is not working
Private Sub Command2_Click() shellexecute (filename) End Sub
That is all, but it is not working
This post has been edited by Xallen: 21 November 2009 - 05:25 PM
#4
Re: VB6 Shortcut button
Posted 23 November 2009 - 08:26 AM
Xallen, on 21 Nov, 2009 - 04:07 PM, said:
I have:
That is all, but it is not working
Private Sub Command2_Click() shellexecute (filename) End Sub
That is all, but it is not working
Hey there.. If your firefox is installed in Program Files(typically), then you can use the following code. You need to use Shell() function to run the exe and Environ$() to locate Program Files directory.
Try this... (in VB6)
Private Sub Command2_Click()
Dim Browser
Browser = Shell(Environ$("ProgramFiles") & "\Firefox\firefox.exe")
End Sub
That's it..
#5
Re: VB6 Shortcut button
Posted 23 November 2009 - 02:41 PM
hi dude 
i bet 3 min search in Google will do. Like so :
http://www.google.co...&...-8&oe=utf-8
remember Google is your friend
i bet 3 min search in Google will do. Like so :
http://www.google.co...&...-8&oe=utf-8
remember Google is your friend
This post has been edited by NoBrain: 23 November 2009 - 02:43 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|