Welcome Guest Search | Active Topics | Sign In | Register

Swapping System.Windows.Forms.WebBrowser for EO.WebBrowser Options
Eric
Posted: Friday, October 24, 2014 10:56:17 AM
Rank: Newbie
Groups: Member

Joined: 10/24/2014
Posts: 2
I'm trying to swap out our System.Windows.Forms.WebBrowser for a EO.WebBrowser and I had a few questions.

1) Is there a sample Win Forms project somewhere I could look at? I see the WPF example that came with installing EO Total 2014.
3) Is there an equivalent to System.Windows.Forms.WebBrowser.ProgressChanged event?
2) Are there WebBrowserNavigatedEventArgs & WebBrowserProgressChangedEventArgs equivalents?

Thanks much in advance,

Eric
eo_support
Posted: Friday, October 24, 2014 9:31:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

The Windows Forms sample code would be almost exactly the same as WPF sample. EO.WebBrowser has two classes: WebView and WebControl. The WebControl is thin wrapper control that are either for Windows Forms or WPF (there are two different WebControl classes, one is EO.WebBrowser.WinForm.WebControl and one is EO.WebBrowser.Wpf.WebControl). You can find more information about this relationship here:

http://www.essentialobjects.com/doc/6/start/overview.aspx

Pretty much the only thing different between WPF and Windows Forms is how you initialize the corresponding WebControl class. You can find step by step information here:

http://www.essentialobjects.com/doc/6/start/winform.aspx

The real class that you will be working with most of the time is the WebView class. This class is independent to Windows Forms or WPF. Once you get the WebControl into the form, the rest is all about working with the WebView class. That part is unrelated to Windows Forms or WPF. So almost all code you find in the WPF sample will work in your Windows Forms application as well.

There is no direct equivalent to ProgressChanged or WebBrowserNavigatedEventArgs. The corresponding events on WebView are LoadCompleted and LoadFailed event. Most of the time you do not need to handle these events like you do with MS WebBrowser control because we have a simple call like this:

webView1.LoadUrlAndWait(url);

This call will not return until the Url finishes loading. As such there is no need for you to handle ProgressChanged event.

You can find all WebView events here:

http://www.essentialobjects.com/doc/6/eo.webbrowser.webviewevents.aspx

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Eric
Posted: Wednesday, November 5, 2014 10:42:16 AM
Rank: Newbie
Groups: Member

Joined: 10/24/2014
Posts: 2
Thanks a ton. This was helpful.
eo_support
Posted: Wednesday, November 5, 2014 11:32:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
You are very welcome. Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.