网页如何出现在VB设计的窗口中?

来源:百度知道 编辑:UC知道 时间:2024/05/19 15:49:53
ms controls部件已填加,代码也清楚.但是如何填加本地网页呢?
用相对地址行不?还有别的思路没?
不要加绝对地址的那种,因为那样的话打包以后,安装到别处,程序就不能用了.不知道哪位高手能理解?

用WebBrowser1控件
然后加载网页时这样写:
WebBrowser1.Navigate App.Path & "\abc.html"
其中App.Path是当前程序所在目录,是相对的

用WebBrowser控件
Private Sub Command1_Click()
If Text1.Text <> "" Then
WebBrowser1.Navigate2 Text1.Text
WebBrowser1.Visible = True
Text2.Visible = False
End If
End Sub

Private Sub Command2_Click()
Text2.Visible = True
Text2.Text = Inet1.OpenURL(Text1.Text)
WebBrowser1.Visible = False
End Sub