Link to home
Start Free TrialLog in
Avatar of chetweewax
chetweewax

asked on

open new form with webbrowser window

I have created my own web browser in vb6 for an intranet project but it was opening links with the _black in internet explorer, so i added the code below to get it to open in a new custom browser window...

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
   Dim frmWB As Browser
   Set frmWB = New Browser

   frmWB.WebBrowser1.RegisterAsBrowser = True

   Set ppDisp = frmWB.WebBrowser1.Object
   frmWB.Visible = True
End Sub

The problem: the new window that is opening, the form will resize but the webbroser inside will not like on the parent window.  I am using the code below to resize webbrowser1 to the size i want in the form.

Private Sub form_resize()
   laststate = Browser.WindowState
   If Browser.WindowState <> vbMinimized Then
       WebBrowser1.Height = Browser.Height - 1300
   End If

   WebBrowser1.Width = Browser.Width - 300
End Sub
ASKER CERTIFIED SOLUTION
Avatar of philgin
philgin
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chetweewax
chetweewax

ASKER

Philgin,

This is working great the only problem i am running into now is that when i close the open windows and open task manager my browser is still appearing open
It's not with the code. Please check your application if you loaded a window and now show it. Or probably a hidden or a windows with visible set to false.