1、CommonDialog的显示
在ActiveX控件中定义的函数调用了该控件,在该ActiveX控件中的code实现了按钮点击事件函数中执行CommonDialog对话框的显示,但是无效!
注:在ActiveX控件code中实现commomDialog的显示函数,在EXE程序中调用该函数,却能够显示该功能。
' 在部件中添加了CommonDialog控件
With CommonDialog1
.Filter = "Office Documents " & _
"(*.doc, *.dot)|*.doc;*.dot"
.FilterIndex = 1
.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly
.FileName = ""
.ShowOpen
sFileName = .FileName
End With2、动态显示webbrowser控件的问题
本人想在exe程序中通过代码动态加载webbrowser控件,但是有问题。希望有实现过的人提供代码
Set MyWebB = Controls.Add("Shell.Explorer.2 ", "123 ")
MyWebB.Move 10, 900, 800, 200
MyWebB.object.Silent = True
MyWebB.object.Navigate "http://www.163.com/ "
MyWebB.Visible = True
在ActiveX控件中定义的函数调用了该控件,在该ActiveX控件中的code实现了按钮点击事件函数中执行CommonDialog对话框的显示,但是无效!
注:在ActiveX控件code中实现commomDialog的显示函数,在EXE程序中调用该函数,却能够显示该功能。
' 在部件中添加了CommonDialog控件
With CommonDialog1
.Filter = "Office Documents " & _
"(*.doc, *.dot)|*.doc;*.dot"
.FilterIndex = 1
.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly
.FileName = ""
.ShowOpen
sFileName = .FileName
End With2、动态显示webbrowser控件的问题
本人想在exe程序中通过代码动态加载webbrowser控件,但是有问题。希望有实现过的人提供代码
Set MyWebB = Controls.Add("Shell.Explorer.2 ", "123 ")
MyWebB.Move 10, 900, 800, 200
MyWebB.object.Silent = True
MyWebB.object.Navigate "http://www.163.com/ "
MyWebB.Visible = True
2、工程属性里--去掉删除有关未使用的activeX控件的信息,确定。
3、测试以下代码:
Private Sub Form_Load()
Set MyWebB = Controls.Add("Shell.Explorer.2", "w123")
MyWebB.Move 10, 900, 800, 200
MyWebB.object.Silent = True
MyWebB.object.Navigate "http://www.163.com/ "
MyWebB.Visible = True
End Sub