Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2008 problems with navigating webbrowser on form1 from form2

$
0
0
I have webbrowser1 on form1.

I would like for a user to be able to click a button on form2 and have that button do two things

1. navigate form1.webbrowser1 from one document to another (for the sake of this lets just say www.google.com to www.yahoo.com)

2. after the webbrowser has navigated continue with the rest of the code

The problem is that the webbrowser will only navigate after the form2 button click is done or after i make a msgbox popup.

Why would the webrowser only navigate after a msgbox pops up?


an example of my form2.buttonclick event






form1.webbrowser1.navigate("www.yahoo.com")

debug.print form1.webbrowser1.url
'shows www.google.com

'i tried making a do while webbrowser1.readystate loop here but it goes forever because webbrowser1 never navigates
'i also tried using the form1.webrowser1 on navigate completed event but again it fails because webrowser1 never navigates.


msgbox ("this msgbox makes the webbrowser navigate")

debug.print form1.webbrowser1.url
'shows www.yahoo.com

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>