vb 学习学习下

方法1:
Private Sub Command1_Click()
    WebBrowser1.Navigate "www.baidu.com"
    While WebBrowser1.ReadyState <> 4
        oEvents
    Wend
    msgbox "加载完毕"
End Sub

方法二:
Private Sub Command1_Click()
    WebBrowser1.Navigate "www.baidu.com"
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    If pDisp Is WebBrowser1.Object Then msgbox "加载完毕"
End Sub

 

添加调试

调试信息  Debug.Print "sdffdsfdas"

你可能感兴趣的:(vb)