扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
Option Explicit Private Sub Form_Load() Me.Caption =“My Explorer” Label1.Caption = “URL” Combo1.Text = “” Combo1.Top = Label1.Height Combo1.Left = 0 WebBrowser1.Top = Combo1.Top + Combo1.Height WebBrowser1.Left = 0 Form_Resize StatusBar1.Style = sbrSimple ProgressBar1.ZOrder End Sub Private Sub Form_Resize() On Error GoTo a Combo1.Width = Form1.Width - 100 WebBrowser1.Width = Combo1.Width WebBrowser1.Height = Form1.Height - Combo1.Height - 1000 ProgressBar1.Top = Me.Height - StatusBar1.Height - 330 ProgressBar1.Left = 0.25 * StatusBar1.Width ProgressBar1.Width = 0.75 * Me.Width - 250 a: End Sub Private Sub Combo1_Click() `转到指定网址 WebBrowser1.Navigate Combo1.Text End Sub Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer) Dim i As Long Dim existed As Boolean If KeyCode = 13 Then If Left(Combo1.Text, 7) <> “http://”Then Combo1.Text = “http://”+ Combo1.Text End If WebBrowser1.Navigate Combo1.Text For i = 0 To Combo1.ListCount - 1 If Combo1.List(i) = Combo1.Text Then existed = True Exit For Else existed = False End If Next If Not existed Then Combo1.AddItem (Combo1.Text) End If End If End Sub Private Sub WebBrowser1_DownloadBegin() `下载开始时状态栏显示“Now Linking...” StatusBar1.SimpleText = “Now Linking...” End Sub Private Sub WebBrowser1_DownloadComplete() `下载完成时状态栏显示“Link Finished” StatusBar1.SimpleText = “Link Finished” ProgressBar1.Value = 0 End Sub Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long) `下载进行时进度条变化 If ProgressMax = 0 Then Exit Sub ProgressBar1.Max = ProgressMax If Progress <> -1 And Progress <= ProgressMax Then ProgressBar1.Value = Progress End If End Sub Private Sub WebBrowser1_TitleChange(ByVal Text As String) Combo1.Text = WebBrowser1.LocationURL End Sub |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者