Welcome Guest Search | Active Topics | Sign In | Register

Close automatically new popup Options
Charly_MNDZ
Posted: Tuesday, December 30, 2014 3:07:16 PM
Rank: Newbie
Groups: Member

Joined: 12/30/2014
Posts: 4
Hi,

I have a doubt with the new windows popup's handler, when I download a file appears a popup form with a showdialog to save, it's right, but when I close the showdialog the new windows popup do not close, How do I close it?

Thanks for support

My code (form this page) is:

Quote:
Private Sub WebView1_NewWindow(sender As Object, e As EO.WebBrowser.NewWindowEventArgs) Handles WebView1.NewWindow
e.Accepted = True
Dim WebBrowerOnPopup = New EO.WebBrowser.WinForm.WebControl
Dim popupForm As New System.Windows.Forms.Form
popupForm.ClientSize = New System.Drawing.Size(System.Convert.ToInt32(e.Width), System.Convert.ToInt32(e.Height))
popupForm.Controls.Add(WebBrowerOnPopup)
WebBrowerOnPopup.Dock = DockStyle.Fill
WebBrowerOnPopup.WebView = e.WebView

popupForm.Show()

AddHandler popupForm.FormClosed, AddressOf Form_Closed

End Sub

Private Sub Form_Closed(sender As Object, e As FormClosedEventArgs)
Dim popupForm As New System.Windows.Forms.Form
popupForm = CType(sender, System.Windows.Forms.Form)
Dim webBrowserOnPopup As EO.WebBrowser.WinForm.WebControl = CType(popupForm.Controls.Item(0), EO.WebBrowser.WinForm.WebControl)

'Call Destroy on the popup WebView
webBrowserOnPopup.WebView.Destroy()
End Sub
eo_support
Posted: Wednesday, December 31, 2014 12:10:09 PM
Rank: Administration
Groups: Administration

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

Inside your NewWindow handler, you need to hook up an event handler to the new WebView's Closed event. Inside the Closed event handler you can then close your form.

Thanks!
Charly_MNDZ
Posted: Thursday, January 8, 2015 1:46:08 PM
Rank: Newbie
Groups: Member

Joined: 12/30/2014
Posts: 4
Thanks for all, I had foun the answer.


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.