Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to prevent AntView to open a new window?
#5
MrPrzemek,

Ok, I tested the code I wrote now.

The code to do what you want looks like this:
Code:
Private Sub EdgeWebBrowser_OnNewWindowRequested(ByVal Args As AntViewAx.IAntViewNewWindowRequestedEventArgs)
  Dim URI As String
  Args.Handled = True
  URI = Args.URI
  EdgeWebBrowser.Navigate URI
End Sub

By setting the NewWindowRequest as Handled, you indicate that you are handling this yourself.
One of the other options is to set the "New Window" to use. You can set this to the current EdgeWebBrowser via (EdgeWebBrowser.Dispatch). However when you do that.. it will actually create a new Window within the current browser object and you loose the ability to use history and go back one page.

Instead what I suggest to do is what is in the code snippet above.
First get the URI that was intended to be navigated towards in a new window and then -instead of creating a new window- navigate to it in the current browser object using the Navigate method.

I will get you a private test build later today after I looked into your other questions.

--
Wil
Reply


Messages In This Thread
RE: How to prevent AntView to open a new window? - by wila - 2022-04-17, 12:57:55

Forum Jump:


Users browsing this thread: 1 Guest(s)