关于VB引用的问题

xq0551 2003-12-24 06:13:39
dim mainMenu as new mainMenu
在定义之前应该引用VB中的甚?谢谢!
...全文
91 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
LanceJin 2003-12-25
  • 打赏
  • 举报
回复
project->components加入引用ocx
LanceJin 2003-12-25
  • 打赏
  • 举报
回复
用API可以搜以前的贴子,把你引用的控件加进去啊
xq0551 2003-12-25
  • 打赏
  • 举报
回复
我要实现的是:程序自动添加菜单,不用API函数。我想用mainMenu控件做,我在网上找到的资源代码如下:
Dim mainMenu As New MainMenu
Me.Menu = mainMenu

Dim miFile As MenuItem = mainMenu.MenuItems.Add("&File")
miFile.MenuItems.Add(new MenuItem("&Open..."))
miFile.MenuItems.Add("-") ' Gives us a seperator
miFile.MenuItems.Add(new MenuItem("E&xit"))
问题的关键是:就像 dim xx as new ADODB 前必须引用Microsoft ActiveX Data Objects 2.6 Library等一样,dim xx as mainMenu前我不知该引用甚,请高手指点!
xq0551 2003-12-25
  • 打赏
  • 举报
回复
原因我已找到,VB.6中没有mainMenu控件,.net则有!谢谢各位!
rainstormmaster 2003-12-24
  • 打赏
  • 举报
回复
不如说说你要实现什么功能
rainstormmaster 2003-12-24
  • 打赏
  • 举报
回复
//谢谢!你误会我的意思了,在没有正确引用之前,根本无法定义为mainMenu,我的意思是:在定义变量为mainMenu型之前,应该在references中引用什么?

你给的信息不足以确定是引用什么组件

看字面的意思应该和菜单相关
lazygod 2003-12-24
  • 打赏
  • 举报
回复
你的第三方控件
flc 2003-12-24
  • 打赏
  • 举报
回复
关注
xq0551 2003-12-24
  • 打赏
  • 举报
回复
谢谢!你误会我的意思了,在没有正确引用之前,根本无法定义为mainMenu,我的意思是:在定义变量为mainMenu型之前,应该在references中引用什么?
LanceJin 2003-12-24
  • 打赏
  • 举报
回复
dim m_mainMenu as mainMenu
set ex_mainMenu = new m_mainMenu

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧