读书人

问几个小问题【每题20分】

发布时间: 2012-03-18 13:55:39 作者: rapoo

问几个问题【每题20分】
1、CommonDialog的显示
在ActiveX控件中定义的函数调用了该控件,在该ActiveX控件中的code实现了按钮点击事件函数中执行CommonDialog对话框的显示,但是无效!
注:在ActiveX控件code中实现commomDialog的显示函数,在EXE程序中调用该函数,却能够显示该功能。

VB code
' 在部件中添加了CommonDialog控件   With CommonDialog1          .Filter = "Office Documents " & _          "(*.doc, *.dot)|*.doc;*.dot"          .FilterIndex = 1          .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly             .FileName = ""          .ShowOpen          sFileName = .FileName       End With


2、动态显示webbrowser控件的问题
本人想在exe程序中通过代码动态加载webbrowser控件,但是有问题。希望有实现过的人提供代码
VB code
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


[解决办法]
1.CommonDialog依赖于窗体,你在AX里无法使用可能是你没有使用对应的窗体。API可以替代它,你可以去搜索一下。

2.我不了解webbrowser。
[解决办法]
探讨

没有人遇到过 第2个问题

读书人网 >VB

热点推荐