1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
|
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "comctl32.ocx"
Begin VB.Form frmToolBar
Caption = "Control Bar"
ClientHeight = 1215
ClientLeft = 165
ClientTop = 735
ClientWidth = 7965
LinkTopic = "Form2"
ScaleHeight = 81
ScaleMode = 3 'Pixel
ScaleWidth = 531
StartUpPosition = 3 'Windows Default
Begin ComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 660
Left = 0
TabIndex = 0
Top = 0
Width = 7965
_ExtentX = 14049
_ExtentY = 1164
ButtonWidth = 1032
ButtonHeight = 1005
AllowCustomize = 0 'False
Appearance = 1
ImageList = "ImageList1"
_Version = 327682
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 10
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "goback"
Object.ToolTipText = "Go Back"
Object.Tag = ""
ImageIndex = 1
EndProperty
BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "goforward"
Object.ToolTipText = "Go Forward"
Object.Tag = ""
ImageIndex = 5
EndProperty
BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "reload"
Object.ToolTipText = "Reload Page"
Object.Tag = ""
ImageIndex = 6
EndProperty
BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
MixedState = -1 'True
EndProperty
BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "gohome"
Object.ToolTipText = "Go Home"
Object.Tag = ""
ImageIndex = 3
EndProperty
BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "gosearch"
Object.ToolTipText = "Search Web"
Object.Tag = ""
ImageIndex = 8
EndProperty
BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "ph"
Object.Tag = ""
Style = 4
Object.Width = 200
MixedState = -1 'True
EndProperty
BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "loadpage"
Object.ToolTipText = "Load this URL"
Object.Tag = ""
ImageIndex = 4
EndProperty
BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
MixedState = -1 'True
EndProperty
BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "stop"
Object.ToolTipText = "Stop Loading"
Object.Tag = ""
ImageIndex = 2
EndProperty
EndProperty
Begin VB.ComboBox cmbUrl
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
ItemData = "frmToolBar.frx":0000
Left = 3120
List = "frmToolBar.frx":0016
TabIndex = 1
Text = "http://www.mozilla.com"
Top = 120
Width = 2895
End
End
Begin VB.OptionButton rbExplorer
Caption = "InternetExplorer"
Height = 255
Left = 2160
TabIndex = 4
Top = 720
Width = 1575
End
Begin VB.OptionButton rbMozilla
Caption = "Mozilla"
Height = 255
Left = 960
TabIndex = 3
Top = 720
Value = -1 'True
Width = 1215
End
Begin ComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 2
Top = 960
Width = 7965
_ExtentX = 14049
_ExtentY = 450
SimpleText = ""
_Version = 327682
BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
NumPanels = 2
BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
AutoSize = 1
Object.Width = 11404
MinWidth = 2646
TextSave = ""
Object.Tag = ""
EndProperty
BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Alignment = 2
Object.Width = 2117
MinWidth = 2117
TextSave = ""
Object.Tag = ""
EndProperty
EndProperty
End
Begin VB.Label Label1
Caption = "Control:"
Height = 255
Left = 120
TabIndex = 5
Top = 720
Width = 855
End
Begin ComctlLib.ImageList ImageList1
Left = 6240
Top = 480
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 8
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":00A4
Key = "back"
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":03BE
Key = "stop"
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":06D8
Key = "home"
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":09F2
Key = "gotopage"
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":0D0C
Key = "forward"
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":1026
Key = "reload"
EndProperty
BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":1340
Key = "go"
EndProperty
BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmToolBar.frx":165A
Key = "gofind"
EndProperty
EndProperty
End
Begin VB.Menu debug
Caption = "Debug"
Begin VB.Menu verbs
Caption = "OLE Verbs"
End
End
End
Attribute VB_Name = "frmToolBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim browser As Object
Private Sub Form_Load()
frmMozilla.Show
frmExplorer.Show
Set browser = frmMozilla.Browser1
End Sub
Sub Browser_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean)
Debug.Print "Browser_BeforeNavigate " & URL
StatusBar1.Panels(1).Text = "Loading " & URL
End Sub
Sub Browser_NavigateComplete(ByVal URL As String)
Debug.Print "Browser_NavigateComplete " & URL
StatusBar1.Panels(1).Text = "Loaded " & URL
StatusBar1.Panels(2).Text = ""
End Sub
Sub Browser_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
Debug.Print "Browser_BeforeNavigate2 " & URL
StatusBar1.Panels(1).Text = "Loaded " & URL
StatusBar1.Panels(2).Text = ""
End Sub
Sub Browser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Debug.Print "Browser_NavigateComplete2 " & URL
StatusBar1.Panels(1).Text = "Loaded " & URL
StatusBar1.Panels(2).Text = ""
End Sub
Sub Browser_StatusTextChange(ByVal Text As String)
Debug.Print "Browser_StatusTextChange " & Text
StatusBar1.Panels(1).Text = Text
End Sub
Sub Browser_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
Dim fProgress As Double
If Progress = 0 Then
' fProgress = 0
ElseIf ProgressMax > 0 Then
' fProgress = (Progress * 100) / ProgressMax
Else
' fProgress = 0#
Debug.Print "Progress error - Progress = " & Progress & ", ProgressMax = " & ProgressMax
End If
' StatusBar1.Panels(2).Text = Int(fProgress) & "%"
End Sub
Private Sub rbExplorer_Click()
Set browser = frmExplorer.Browser1
End Sub
Private Sub rbMozilla_Click()
Set browser = frmMozilla.Browser1
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
Select Case Button.Key
Case "goback"
browser.GoBack
Case "goforward"
browser.GoForward
Case "reload"
browser.Refresh
Case "gohome"
browser.GoHome
Case "gosearch"
browser.GoSearch
Case "loadpage"
browser.Navigate cmbUrl.Text
Case "stop"
browser.Stop
Case Else
End Select
End Sub
Private Sub verbs_Click()
' Query the browser to see what IOleCommandTarget commands it supports
Dim nCmd As Integer
Dim nStatus As Integer
For nCmd = 1 To 40
nStatus = browser.QueryStatusWB(nCmd)
If nStatus And 1 Then
Debug.Print "Command " & nCmd & " is supported"
Else
Debug.Print "Command " & nCmd & " is not supported"
End If
If nStatus And 2 Then
Debug.Print "Command " & nCmd & " is disabled"
End If
Next
End Sub
|