Quantcast
Viewing all articles
Browse latest Browse all 27020

WebBrowser.NewWindow event - Can it block dialogs?

I'm using the webbrowser control to login to this forum, but I'd like to detect or suppress the "You have a new private message" dialog window from showing,....
Image may be NSFW.
Clik here to view.
Name:  browser_pv_msg.png
Views: 159
Size:  24.9 KB


This is hard for me to test since if I send a private message to myself it seems the dialog doesn't show up, so... Does anyone know if the code below will block these dialog windows?
Code:

Private Sub WebBrowser1_NewWindow(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
    ' will this block "You have a new private message" dialogs also?
    e.Cancel = True
End Sub


Otherwise, maybe you can send me a private message so I can do some testing :), Thanks!


BTW, I know one way to close the dialog but it requires a timer and some API, hoping to avoid that!
Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing all articles
Browse latest Browse all 27020

Trending Articles