


全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
此文档收集于网络,如有侵权,请联系网站删除SolidWorks API HelpCreate Submenus in the CommandManager Example (VBA)This example shows how to create submenus in the CommandManager framework by creating individual CommandGroups for each submenu in your tree. The CommandGroup can be used as a path to the submenu.-public bool ConnectToSW(object ThisSW, int Cookie)iApp = ThisSW as SldWorks.SldWorks;iCookie = Cookie;iApp.SetAddinCallbackInfo(0, this, iCookie);iCommand = iApp.GetCommandManager(iCookie);SldWorks.CommandGroup commandGroup = null;string title = CommandGroup1;string toolTip = Command group 1 tip;string hint = Command group 1 hint;int position = 6;commandGroup = iCommand.CreateCommandGroup(CommandGroupID1, title, toolTip, hint, position);if (commandGroup != null)BitmapHandler bitmapHandler = new BitmapHandler();commandGroup.LargeIconList = bitmapHandler.CreateFileFromResource(CommandManager.LargeIconList.bmp);commandGroup.LargeMainIcon = bitmapHandler.CreateFileFromResource(CommandManager.LargeMainIcon.bmp);commandGroup.SmallIconList = bitmapHandler.CreateFileFromResource(CommandManager.SmallIconList.bmp);commandGroup.SmallMainIcon = bitmapHandler.CreateFileFromResource(CommandManager.SmallMainIcon.bmp);commandGroup.ShowInDocumentType = (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeNONE;/ |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypePART |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeASSEMBLY |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeDRAWING;commandGroup.AddCommandItem2(Command1, -1, Command1 hint, Command1 tool tip, 0, OnCommand1, OnMenuUpdate, 0, 1);commandGroup.AddCommandItem2(Command2, -1, Command2 hint, Command2 tool tip, 1, OnCommand2, OnMenuUpdate, 0, 1);commandGroup.HasMenu = true;commandGroup.HasToolbar = true;commandGroup.Activate();commandGroup = null;title = CommandGroup1CommandSubGroup1;toolTip = Command sub group 1 tip;hint = Command sub group 1 hint;position = -1;commandGroup = iCommand.CreateCommandGroup(CommandGroupID2, title, toolTip, hint, position);if (commandGroup != null)BitmapHandler bitmapHandler = new BitmapHandler();commandGroup.LargeIconList = bitmapHandler.CreateFileFromResource(CommandManager.LargeIconList.bmp);commandGroup.LargeMainIcon = bitmapHandler.CreateFileFromResource(CommandManager.LargeMainIcon.bmp);commandGroup.SmallIconList = bitmapHandler.CreateFileFromResource(CommandManager.SmallIconList.bmp);commandGroup.SmallMainIcon = bitmapHandler.CreateFileFromResource(CommandManager.SmallMainIcon.bmp);commandGroup.ShowInDocumentType = (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeNONE;/ |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypePART |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeASSEMBLY |/ (int)SwConst.swDocTemplateTypes_e.swDocTemplateTypeDRAWING;commandGroup.AddCommandItem2(SubCommand1, -1, Command1 hint, Command1 tool tip, 0, OnCommand1, OnMenuUpdate, 0, 1);commandGroup.AddCommandItem2(SubCommand2, -1, Command2 hint, Comm
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年银行岗位题库附答案详解
- 2025年铁路维修安全试题及答案
- 2025年血液净化中心专科考试题目(附答案)
- 2025年辽宁省公务员考试公共基础知识试题库(含答案)
- 2025年地质灾害防治知识竞赛试题及答案
- 大同市中医院颅内外动脉闭塞再通技术考核
- 2025年技能理论考试护理敏感指标试题完整版及答案
- 邢台市人民医院宫腔镜子宫内膜息肉切除术考核
- 黑河市人民医院DSA设备操作资格认证
- 吉林省长春市朝阳区2023-2024学年高三上学期语文9月月考试卷(含答案)
- 2025年及未来5年中国专用灯具行业市场调研及投资战略研究报告
- 2025年新版中国移动笔试题库及答案
- 安徽省农村信用社联合社2026年校园招聘备考考试题库附答案解析
- 肺结节培训课件
- 化工安全三级培训考试题及答案解析
- 2025年湖北省生态环保有限公司招聘33人笔试参考题库附带答案详解
- 2025湖北宜昌市不动产交易和登记中心招聘编外聘用人员17人考试参考试题及答案解析
- 教PEP版六年级英语上册第一次月考试卷(Unit 1-2).(含答案含听力原文)
- 远离宗教崇尚科学课件
- 全国大学生职业规划大赛《民航运输服务》专业生涯发展展示【高职(专科)】
- 第八章健美操健美操组合动作教学设计人教版初中体育与健康八年级全一册
评论
0/150
提交评论