Welcome Guest Search | Active Topics | Sign In | Register

Share WebView between Winforms controller Options
Jonathan
Posted: Wednesday, November 3, 2021 4:07:37 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2021
Posts: 2
I'm creating an application which uses tabs. Some of the tabs needs to include a webview. Is there a way without changing parent on the WebView to be added to several controllers?

Reason I would like to solve this is the amount of memory allocated by all instances but also minimize network load as parts of the webpage is rather big and I need to minimize time spent on download.
eo_support
Posted: Wednesday, November 3, 2021 9:06:16 AM
Rank: Administration
Groups: Administration

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

This has nothing to do with the WebView. It has to do with the TabControl you use. For example, the most rudimentary tab control is just a row of buttons and you then handle the button click event to show/hide whatever you want to show. In your click event you can have code like this:

Code: C#
if (index_of_button_clicked index_of_button_clicked < 3)
    webView.Visible = true;
else
    webView.Visible = false;


Here the first three tabs shows the WebView and the rest hide it. So the result is the first three tabs shares a single WebView. As you can see, this logic is on the tab control side or in your code. It would not be on the WebView side.

Thanks!


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.