Thank you for the tip. Actually, I figured out a couple of things (btw, I
confess that I am really a vB guy and was studying a sample I found in C# -
forgot about the parens - lazy vb guy - the IDE puts em in for me). But I am
able to get the current url from the documentcompleted event of the web
browser.
So you say that the web browser control from the toolbox and
System.Windows.Forms.WebBrowser
are not the same?
In the components initialize page of my app it says
Me.web1 = New System.Windows.Forms.WebBrowser
Well, anyway, I solved my problem. I thank you all for your replies and tips.
> Thank you for the tip. Actually, I figured out a couple of things (btw, I
> confess that I am really a vB guy and was studying a sample I found in C# -
[quoted text clipped - 5 lines]
> System.Windows.Forms.WebBrowser
> are not the same?
I don't know what's in your toolbox, but if you're constructing it as
you described in your original post, then no, they're not the same.
System.Windows.Forms.WebBrowser does not have a Navigate2 method (it
has a Navigate method that takes far fewer arguments).
> In the components initialize page of my app it says
>
> Me.web1 = New System.Windows.Forms.WebBrowser
Then you're not using the same code or control as you posted
originally. You're now using the newer, more sensible control:
WebBrowser webBrowser = new WebBrowser();
webBrowser.Navigated += webBrowser_Navigated;
...
private void webBrowser_Navigated(object sender,
WebBrowserNavigatedEventArgs e)
{
Console.WriteLine(e.Url.ToString());
}
...
webBrowser.Navigate("http://www.google.com");
...
Note that you need to wait for the control to finish navigating before
you can retrieve the URL, as shown above.
Michael
Michael
Rich - 26 Sep 2007 21:37 GMT
I see your point. the webbrowser control from the toolbox (VS2005) does not
have a Navigate2 property. I will use the SystemWindows.Forms.WebBrowsert.
Thanks for the tip
> > Thank you for the tip. Actually, I figured out a couple of things (btw, I
> > confess that I am really a vB guy and was studying a sample I found in C# -
[quoted text clipped - 36 lines]
>
> Michael