• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

NewWindow2

In Visual Basic 6, I'm created a MDI browser, however I'm not entirely sure how the NewWindow2 function works for trapping new windows. Can someone give me an example of how it works? Thanks in advance.

Alex
0
AlexSeifert
Asked:
AlexSeifert
  • 2
1 Solution
 
TrevorParnhamntlCommented:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)



' Create new instance of form
Set frmWB = New frmWeb
   frmWB.Visible = False

   frmWB.WebBrowser1.RegisterAsBrowser = True

   Set ppDisp = frmWB.WebBrowser1.object



'   frmWB.Visible = True
   
   frmWB.WebBrowser1.Visible = True
   
   
   
   
'   frmWB.WebBrowser1.Left = frmWB.Left
'   frmWB.WebBrowser1.Top = Me.Top


 'ppDisp.Left = frmWB.Left
'
'
''frmwb_GotFocus
'
'
frmWB.Left = 1800
frmWB.Top = 2300
WebBrowser1_Validate (Cancel)




End Sub
0
 
TrevorParnhamntlCommented:
Sorry, sent previous answer with some of my doodling. This is the correct code you need

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)



' Create new instance of form
Set frmWB = New frmWeb
   frmWB.Visible = False

   frmWB.WebBrowser1.RegisterAsBrowser = True

   Set ppDisp = frmWB.WebBrowser1.object

   
   frmWB.WebBrowser1.Visible = True
   
   
End Sub
0
 
AlexSeifertAuthor Commented:
Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now