VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A simple web browser, with capabilities such as source code finder, loading web sites, etc.

by Benjamin Patrick (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 11th September 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A simple web browser, with capabilities such as source code finder, loading web sites, etc.

API Declarations


'Create 2 forms----ami.frm and form1.frm
Add Internet common controls, inet, richtextbox, imagecontrol, toolbar control, and create a menu for source code finder.

Rate A simple web browser, with capabilities such as source code finder, loading web sites, etc.



On Error Resume Next
WebBrowser1.Navigate (Text1.Text)
Text1.Text = Me.Caption
End Sub


Private Sub mnuSource_Click()
On Error GoTo eH
Dim Source1 As String
Dim Source As String
If Len(Text1) > 0 Then
    Source1 = Inet1.OpenURL(Text1.Text)
    If Len(Source1) > 0 Then
      Form1.Text1.Text = Source1
        Me.Inet1.Cancel
        Form1.Show ([vbModal])
    Else
        Source = MsgBox("Source code is not available.", vbInformation, "Source Code")
    End If
End If
Exit Sub

eH:
MsgBox "Critical problem" & vbCr & "Problem " & Err.Number & ": " & Err.Description & vbCr & vbCr & "Please try again", vbCritical, "Problem"

End Sub

Private Sub timTimer_Timer()
    If WebBrowser1.Busy = False Then
        timTimer.Enabled = False
        Me.Caption = WebBrowser1.LocationName
    Else
        Me.Caption = "Working..."
    End If
End Sub

Private Sub Form_Resize()
    Text1.Width = Me.ScaleWidth - 100
    WebBrowser1.Width = Me.ScaleWidth - 100
    WebBrowser1.Height = Me.ScaleHeight - 100
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
On Error Resume Next
WebBrowser1.GoBack
Text1.Text = WebBrowser1.LocationURL
Case 2
On Error Resume Next
WebBrowser1.GoForward
Text1.Text = WebBrowser1.LocationURL
Case 3
On Error Resume Next
WebBrowser1.GoForward
Text1.Text = WebBrowser1.LocationURL
Case 4
On Error Resume Next
WebBrowser1.Refresh
Case 5
On Error Resume Next
WebBrowser1.Stop
Case 6
On Error Resume Next
WebBrowser1.GoSearch
End Select
End Sub


Download this snippet    Add to My Saved Code

A simple web browser, with capabilities such as source code finder, loading web sites, etc. Comments

No comments have been posted about A simple web browser, with capabilities such as source code finder, loading web sites, etc.. Why not be the first to post a comment about A simple web browser, with capabilities such as source code finder, loading web sites, etc..

Post your comment

Subject:
Message:
0/1000 characters