Link to home
Start Free TrialLog in
Avatar of MTec89_
MTec89_Flag for United States of America

asked on

web browser

im trying to make a web browser, but it seems that links open in IE instead of opening a nother copy of my browser. also i cant get my forward and previous browse buttons working, they crash if the user goes back or forward father than the hostory shows.
Avatar of Erick37
Erick37
Flag of United States of America image

From MS:

"The WebBrowser control supports a CommandStateChange event, which is fired whenever the Forward or Back buttons need to be enabled or disabled. "

http://support.microsoft.com/default.aspx?scid=kb;EN-US;163282

' A Visual Basic application can also implement this
' functionality in this manner:  

Private Const CSC_NAVIGATEFORWARD As Long = 1
Private Const CSC_NAVIGATEBACK As Long = 2


Private Sub WebBrowser_CommandStateChange(ByVal Command As Long,ByVal Enable As Boolean)

       Select Case Command
           Case CSC_NAVIGATEBACK
               YourBackButtonName.Enabled = Enable
           Case CSC_NAVIGATEFORWARD
               YourForwardButtonName.Enabled = Enable
       End Select

End Sub

ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America 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 MTec89_

ASKER

Private Sub wWeb_NewWindow2(ppDisp As Object, Cancel As Boolean)
   Dim frmWB As frmMain
   Set frmWB = New frmMain
   frmWB.wWeb.RegisterAsBrowser = True
   Set ppDisp = frmWB.wWeb.Object
   frmWB.Visible = True
End Sub


ambiguous name "wWeb_NewWindow2"
Avatar of MTec89_

ASKER

ignore last post from me. if i figuer out how to split points, ill accept u both
Avatar of MTec89_

ASKER

even though i closed, i get resizing errors with the dialog, can u help me fix this

Private Sub Form_Resize()
    If Me.WindowState <> vbMinimized Then
        wWeb.Width = Me.Width - 105
        wWeb.Height = Me.Height - 1000 - StatusBar1.Height
        wWeb.Top = 400
        wWeb.Left = 0
        cboURL.Width = Me.Width - cboURL.Left - 150
    End If
End Sub
You have to be sure that the result of your calculations do not result in negative numbers.

Instead of:
wWeb.Width = Me.Width - 105

do something like
w = Me.Width - 105
if w > 0 then wWeb.Width = w
Avatar of MTec89_

ASKER

thanks :) i got it working