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

解决方案 »

  1.   

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

  2.   

    1、添加webbrowser到工具栏(即添加部件microsoft internet controls)
    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