You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
8.0 KiB

VERSION 5.00
Object = "{831FDD16-0C5C-11d2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Begin VB.Form frmBrowser
ClientHeight = 5130
ClientLeft = 3060
ClientTop = 3345
ClientWidth = 6540
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5130
ScaleWidth = 6540
ShowInTaskbar = 0 'False
Begin MSComctlLib.Toolbar tbToolBar
Align = 1 'Align Top
Height = 540
Left = 0
TabIndex = 3
Top = 0
Width = 6540
_ExtentX = 11536
_ExtentY = 953
ButtonWidth = 820
ButtonHeight = 794
Appearance = 1
ImageList = "imlIcons"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 6
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Back"
Object.ToolTipText = "·µ»Ø"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Forward"
Object.ToolTipText = "Ïòǰ"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Stop"
Object.ToolTipText = "Í£Ö¹"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Refresh"
Object.ToolTipText = "Ë¢ÐÂ"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Home"
Object.ToolTipText = "Ö÷Ò³"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Search"
Object.ToolTipText = "ËÑË÷"
ImageIndex = 6
EndProperty
EndProperty
End
Begin SHDocVwCtl.WebBrowser brwWebBrowser
Height = 3734
Left = 50
TabIndex = 0
Top = 1215
Width = 5393
ExtentX = 9525
ExtentY = 6588
ViewMode = 1
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 0
AutoArrange = -1 'True
NoClientEdge = -1 'True
AlignLeft = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = ""
End
Begin VB.Timer timTimer
Enabled = 0 'False
Interval = 5
Left = 5880
Top = 1500
End
Begin VB.PictureBox picAddress
Align = 1 'Align Top
BorderStyle = 0 'None
Height = 675
Left = 0
ScaleHeight = 675
ScaleWidth = 6540
TabIndex = 4
TabStop = 0 'False
Top = 540
Width = 6540
Begin VB.ComboBox cboAddress
Height = 315
Left = 45
TabIndex = 2
Text = "¯¯½áÊø!"
Top = 300
Width = 3795
End
Begin VB.Label lblAddress
Caption = "µØÖ·(&A):"
Height = 255
Left = 45
TabIndex = 1
Tag = "&Address:"
Top = 60
Width = 3075
End
End
Begin MSComctlLib.ImageList imlIcons
Left = 2670
Top = 2325
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 24
ImageHeight = 24
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":02E2
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":05C4
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":08A6
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":0B88
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Web ä¯ÀÀÆ÷.frx":0E6A
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmBrowser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public StartingAddress As String
Dim mbDontNavigateNow As Boolean
Private Sub Form_Load()
On Error Resume Next
Me.Show
tbToolBar.Refresh
Form_Resize
cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15
If Len(StartingAddress) > 0 Then
cboAddress.Text = StartingAddress
cboAddress.AddItem cboAddress.Text
'ÊÔͼ¶ÔÆô¶¯µØÖ·½øÐÐä¯ÀÀ
timTimer.Enabled = True
brwWebBrowser.Navigate StartingAddress
End If
End Sub
Private Sub brwWebBrowser_DownloadComplete()
On Error Resume Next
Me.Caption = brwWebBrowser.LocationName
End Sub
Private Sub brwWebBrowser_NavigateComplete(ByVal URL As String)
Dim i As Integer
Dim bFound As Boolean
Me.Caption = brwWebBrowser.LocationName
For i = 0 To cboAddress.ListCount - 1
If cboAddress.List(i) = brwWebBrowser.LocationURL Then
bFound = True
Exit For
End If
Next i
mbDontNavigateNow = True
If bFound Then
cboAddress.RemoveItem i
End If
cboAddress.AddItem brwWebBrowser.LocationURL, 0
cboAddress.ListIndex = 0
mbDontNavigateNow = False
End Sub
Private Sub cboAddress_Click()
If mbDontNavigateNow Then Exit Sub
timTimer.Enabled = True
brwWebBrowser.Navigate cboAddress.Text
End Sub
Private Sub cboAddress_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = vbKeyReturn Then
cboAddress_Click
End If
End Sub
Private Sub Form_Resize()
cboAddress.Width = Me.ScaleWidth - 100
brwWebBrowser.Width = Me.ScaleWidth - 100
brwWebBrowser.Height = Me.ScaleHeight - (picAddress.Top + picAddress.Height) - 100
End Sub
Private Sub timTimer_Timer()
If brwWebBrowser.Busy = False Then
timTimer.Enabled = False
Me.Caption = brwWebBrowser.LocationName
Else
Me.Caption = "ÕýÔÚ¹¤×÷..."
End If
End Sub
Private Sub tbToolBar_ButtonClick(ByVal Button As Button)
On Error Resume Next
timTimer.Enabled = True
Select Case Button.Key
Case "Back"
brwWebBrowser.GoBack
Case "Forward"
brwWebBrowser.GoForward
Case "Refresh"
brwWebBrowser.Refresh
Case "Home"
brwWebBrowser.GoHome
Case "Search"
brwWebBrowser.GoSearch
Case "Stop"
timTimer.Enabled = False
brwWebBrowser.Stop
Me.Caption = brwWebBrowser.LocationName
End Select
End Sub