-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm3.frm
248 lines (248 loc) · 7.5 KB
/
Form3.frm
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
VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "ieframe.dll"
Begin VB.Form Form3
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Caption = "小窗模式"
ClientHeight = 8595
ClientLeft = 4245
ClientTop = 2490
ClientWidth = 12315
ControlBox = 0 'False
FillColor = &H00FFFFFF&
Icon = "Form3.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8595
ScaleWidth = 12315
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command4
Caption = "停止"
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 10560
TabIndex = 8
Top = 120
Width = 735
End
Begin VB.CommandButton Command2
Caption = "主页"
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 9720
TabIndex = 7
Top = 120
Width = 735
End
Begin VB.CommandButton Command1
Caption = "刷新"
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8880
TabIndex = 6
Top = 120
Width = 735
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "微软雅黑"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 5
Top = 120
Width = 6975
End
Begin SHDocVwCtl.WebBrowser WebBrowser1
Height = 6735
Left = 0
TabIndex = 4
Top = 600
Width = 12285
ExtentX = 21669
ExtentY = 11880
ViewMode = 0
Offline = 0
Silent = 0
RegisterAsBrowser= 0
RegisterAsDropTarget= 1
AutoArrange = 0 'False
NoClientEdge = 0 'False
AlignLeft = 0 'False
NoWebView = 0 'False
HideFileNames = 0 'False
SingleClick = 0 'False
SingleSelection = 0 'False
NoFolders = 0 'False
Transparent = 0 'False
ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
Location = "http:///"
End
Begin VB.CommandButton GO
Caption = "访问"
Default = -1 'True
Height = 375
Left = 5160
TabIndex = 3
Top = 120
Width = 735
End
Begin VB.CommandButton EXIT
Caption = "退出"
BeginProperty Font
Name = "微软雅黑"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 11400
MaskColor = &H00808080&
TabIndex = 2
Top = 120
Width = 735
End
Begin VB.CommandButton FORWARD
Caption = "→"
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 1
Top = 120
Width = 735
End
Begin VB.CommandButton BACK
Caption = "←"
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 735
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef dwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub BACK_Click()
WebBrowser1.GoBack
End Sub
Private Sub Command1_Click()
WebBrowser1.REFRESH
End Sub
Private Sub Command2_Click()
WebBrowser1.Navigate "https://cn.bing.com"
End Sub
Private Sub Command4_Click()
WebBrowser1.stop
End Sub
Private Sub EXIT_Click()
Locker.Show
HomeAddress = Form3.WebBrowser1.LocationURL
Locker.WebBrowser1.Navigate HomeAddress
Unload Me
End Sub
Private Sub FORWARD_Click()
On Error Resume Next
WebBrowser1.GoForward
End Sub
Private Sub Go_Click()
On Error Resume Next
WebBrowser1.Navigate Trim(Text1.Text) '打开网页
End Sub
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
WebBrowser1.Navigate2 WebBrowser1.Document.activeElement.href
End Sub
Private Sub Form_Load()
Call Go_Click
HomeAddress = Locker.WebBrowser1.LocationURL
WebBrowser1.Navigate HomeAddress
End Sub
Private Sub Form_Resize()
On Error Resume Next
WebBrowser1.Width = Form3.Width - 120
WebBrowser1.Height = Form3.Height - 1000
End Sub
Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Text1.Text = WebBrowser1.LocationURL
If WebBrowser1.Busy = True Then
Text1.ForeColor = &H808080
Else
Text1.ForeColor = &H0&
End If
If InternetGetConnectedState(0&, 0&) Then
Else
Form9.Show
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) '回车键,需要改按钮
On Error Resume Next
If KeyAscii = vbKeyReturn Then
Go_Click
Text1.Text = Text1.Text
End If
If Text1.ForeColor = &H808080 Then
Text1.ForeColor = &H0&
End If
End Sub
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error Resume Next
'如果单击搜索框,让搜索文字消失
If Text1.ForeColor = &H808080 Then
Text1.ForeColor = &H0&
End If
End Sub