I’m sure someone knows about the Google API service, so far I was able to get a list of 10 URL in a list box. My question is how do I make it possible for a user to double click on a URL and have the page to it open in a web browser window?
Printable View
I’m sure someone knows about the Google API service, so far I was able to get a list of 10 URL in a list box. My question is how do I make it possible for a user to double click on a URL and have the page to it open in a web browser window?
heres a lil sample.... could do something like this: wud open explorer (IE) and go to whatever is in the selected list1's text.
in the click event for list1.
dim site as string
site = list1.text
shell "explorer " & site
did a lil test. this works fine
VB Code:
Private Sub Form_Load() List1.AddItem "www.google.com" List1.AddItem "www.yahoo.com" List1.AddItem "www.vbforums.com" End Sub Private Sub List1_DblClick() Dim site As String site = List1.Text Shell "explorer http://" & site, vbNormalFocus End Sub
Also remember you can use shellexecute api to launch default browser...in my code i just launch IE. :rolleyes:
Thank you for taking the time to answer my question, I did have to make a few changes but it got me in the right direction, thank you again
Here is the code I had to use:
VB Code:
Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick Dim site As String site = ListBox1.SelectedItem.ToString Shell("explorer " & site, vbNormalFocus) End Sub
Didn't know you were using .NET :p
Glad i could help though.
Also Welcome to the forums!
please add [resolved] and a checkmark to your orginal post since your post has been solved. :wave:
I thought I specified, guess not. Even I know there is a big difference between them
How can I get the browser to display? when I use the code the browser opens already minimized.
vbMaximized should do it. (I think it's also in .Net)
vbMaximizedFocus ;)
it doesn't. That was the first thing I tried.
Quote:
Originally Posted by Doc Scheinder
It should work..... vbMaximizedFocus
if it isnt, try vbnormalfocus or something else to see if they have any effect.
When push comes to shove, go with the showwindow api or sendmessag + an sw message to show or maximize.
:wave: