How to handle the New Window Event error

An Essential Objects admin showed me how to handle the New Window event error.  You have to click on WebView then select the events icon and then scroll down to New Window then click on it and a method will be created. Type the following in the body of the method:


//Step 1:

            //Create a new Form with a blank WebControl

            //This new Form is the popup window

            Form wsform1 = new Form();

            wsform1.Text = "Wesley Snipes Afterburn - by Jackson D.W.";

            wsform1.Icon = Properties.Resources.WesleySnipes;

            wsform1.WindowState = System.Windows.Forms.FormWindowState.Maximized;

            EO.WinForm.WebControl wswebControl = new EO.WinForm.WebControl();

            wswebControl.Dock = DockStyle.Fill;

            wsform1.Controls.Add(wswebControl);


            //Step 2:

            //Put the new WebView (created by the browser engine)

            //in the new blank WebControl

            wswebControl.WebView = e.WebView;


            //Step 3:

            //Display the new Form

            wsform1.Show();


            //Step 4:

            //Notify the browser engine that you "accept" (and display)

            //the popup

            e.Accepted = true;

Comments

Popular posts from this blog

Back At it

WELCOME to my App Development website