Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser.WebView vs WebView control Options
Biz
Posted: Thursday, June 27, 2024 9:04:45 PM
Rank: Member
Groups: Member

Joined: 8/26/2014
Posts: 20
Referring to the documentation here:

https://www.essentialobjects.com/doc/webbrowser/start/winform.html

After the above steps, you can use the newly added WebView component in your code directly. For example:

We have been using your product for over a decade and never used the WebView control. So, we have always done:

webControl.WebView.LoadUrl(UrlTextBox.Text);

instead of:

webView1.Url = UrlTextBox.Text;

After upgrading to 2024 (previous version was 2019), we found that the loaded page was "somewhat frozen" (as in, it does not accept UI interaction). Tabs work. When we switched to using the WebView control, it worked.

Should we using the WebView control that gets attached to the form instead of the WebView property of the web control?

eo_support
Posted: Thursday, June 27, 2024 10:06:21 PM
Rank: Administration
Groups: Administration

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

By default, webControl1.WebView and webView1 should point to the same object. The code that are automatically generated by the form designer should be something like this:

Code: C#
webControl1 = new EO.WinForm.WebControl();
webView1 = new EO.WebBrowser.WebView();
webControl1.WebView = webView1;


As result, webControl1.WebView and webView1 points to the same object. However this can be changed through WebControl's property window. For example, if you have another WebView object webView2 in your form, you could change webView1.WebView to webView2 in property window. Obviously if webView1.WebView points to webView2, then setting webView1.Url would not load anything into webControl1.

Thanks!
Biz
Posted: Friday, June 28, 2024 8:37:05 PM
Rank: Member
Groups: Member

Joined: 8/26/2014
Posts: 20
I think I figured it out.

There is a difference between

webControl.WebView.LoadUrl(UrlTextBox.Text);

and

webControl.WebView.Url = UrlTextBox.Text;

Also, the test app was using an old version (2017). So it could be that as well.
eo_support
Posted: Saturday, June 29, 2024 2:27:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,166
Biz wrote:
There is a difference between

webControl.WebView.LoadUrl(UrlTextBox.Text);

and

webControl.WebView.Url = UrlTextBox.Text;


These two are exactly the same in the latest version.


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.