vb6.0的webbrowse的所有属性方法与事件
发布网友
发布时间:2023-05-31 23:43
我来回答
共4个回答
热心网友
时间:2024-12-10 01:53
VB的工具箱窗口并没有WebBrowser控件,我们可以这样添加:
右击工具箱窗口--->部件--->选上Microsoft Internet Controls--->确定
WebBrowser控件
shdocvw.dll
基本操作:
Webbrowser用法:
goforward 前进
goback 后退
gohome 回主页
navigate 浏览
stop 停止
gosearch 搜索
属性:
LocationURL网页地址
LocationName网页标题
Path所在容器地址
点击新窗口链接时不打开IE
Private Sub WebBrowser1_NewWindow2( ppDisp As Object, Cancel As Boolean)
Set ppDisp = WebBrowser1.Object
End Sub
热心网友
时间:2024-12-10 01:53
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
热心网友
时间:2024-12-10 01:54
http://hi.baidu.com/lovemoe/blog
来我的blog看看 我自己整理的 可以说是网上最全的。
热心网友
时间:2024-12-10 01:55
http://www.skycn.com/search.php
到这儿下载吧.