2个回答
展开全部
动态添加,动态删除。注意工程中不要引用 webbrowser控件(控件中的microsoft internet controls前面的钩去掉)
Option Explicit
Public WithEvents br As VBControlExtender
Private Sub Command1_Click()
Me.Controls.Remove br ‘去掉webbrowser
End Sub
Private Sub Form_Load()
'On Error Resume Next
'If Licenses.Count = 0 Then
Licenses.Add "Shell.Explorer.2", "Shell.Explorer.2"
Set br = Me.Controls.Add("Shell.Explorer.2", "br")
'br.Width = 650 * Screen.TwipsPerPixelX 大小随你改
'br.Height = 350 * Screen.TwipsPerPixelY
br.Visible = True
br.object.Navigate "http://www.baidu.com/"
End Sub
Option Explicit
Public WithEvents br As VBControlExtender
Private Sub Command1_Click()
Me.Controls.Remove br ‘去掉webbrowser
End Sub
Private Sub Form_Load()
'On Error Resume Next
'If Licenses.Count = 0 Then
Licenses.Add "Shell.Explorer.2", "Shell.Explorer.2"
Set br = Me.Controls.Add("Shell.Explorer.2", "br")
'br.Width = 650 * Screen.TwipsPerPixelX 大小随你改
'br.Height = 350 * Screen.TwipsPerPixelY
br.Visible = True
br.object.Navigate "http://www.baidu.com/"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询