Welcome Guest Search | Active Topics | Sign In | Register

Fixed The Handle New Window Event Options
Derrick W. Jackson
Posted: Friday, June 3, 2022 4:25:15 AM
Rank: Member
Groups: Member

Joined: 5/15/2022
Posts: 10
To solve this problem I did the following.

1. Click on Form1.cs Designer

2, Clicked webView1 and looked at properties on the right side of the screen.

3. Clicked on The Events icon.

4. Scrolled down to NewWindow and clicked on NewWindow text on left side then I hit menu selection and selected

webView1_NewWindow

5. that method was added and I typed the following in the method:

webcontrol1.WebView.Url = e.TargetUrl;
eo_support
Posted: Friday, June 3, 2022 9:26:34 AM
Rank: Administration
Groups: Administration

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

The steps you provided is not the "normal" way of handling this event. The "normal" way (to allow the popup to show) should be something like this:

Code: C#
//Step 1:
//Create a new Form with a blank WebControl
//This new Form is the popup window
Form form1 = new Form();
EO.WinForm.WebControl webControl = new EO.WinForm.WebControl();
webControl.Dock = DockStyle.Fill;
form1.Controls.Add(webControl);

//Step 2:
//Put the new WebView (created by the browser engine)
//in the new blank WebControl
webControl.WebView = e.WebView;

//Step 3:
//Display the new Form
form1.Show();

//Step 4:
//Notify the browser engine that you "accept" (and display)
//the popup
e.Accepted = true;


You should not change step 2 and step 4. However you can customize step 1 and step 3 however you wanted. For example, the above code creates a new top level form and put the WebView inside that Form. You may want to create a tab in a TabStrip instead. You could also put it inside one of your existing Form (for example, your main WebView on the left, "popup" WebView on the right). This part is completely up to you.

Hope this helps.

Thanks
Derrick W. Jackson
Posted: Friday, June 3, 2022 4:43:35 PM
Rank: Member
Groups: Member

Joined: 5/15/2022
Posts: 10
Hi, thanks so much for your quick response. I will try this and post back how it worked. Thanks a lot.

Derrick
eo_support
Posted: Friday, June 3, 2022 6:48:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
You are very welcome. Please feel free to let us know if there is anything else.
Derrick W. Jackson
Posted: Saturday, June 4, 2022 1:59:31 AM
Rank: Member
Groups: Member

Joined: 5/15/2022
Posts: 10
I used your code and it worked great. Thank you Essential Objects!!!!


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.