- 积分
- 344
- 明经币
- 个
- 注册时间
- 2010-10-21
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
带式菜单
使用菜单需要加入如下引用: AcDbMgd, AcMgd, AdWindows, PresentationCore, PresentationFramework , WindowsBase (PresentationCore, PresentationFramework , WindowsBase)我的系统是vs2005+cad2010 这3个去哪儿找,我找了半天 也没有找到,如何解决.
using System; using Autodesk.Windows; using Autodesk.AutoCAD.Runtime; [assembly: CommandClass(typeof(Sample.Ribbon))] namespace Sample { class Ribbon { [CommandMethod("AddRibbon")] public void AddRibbon() { RibbonControl rc = RibbonControl(); RibbonTab rt = RibbonTab("菜单标签", "1"); RibbonPanel rp = RibbonPanel("菜单面板"); RibbonButton rb = RibbonButton("菜单按钮", "菜单命令"); rp.Source.Items.Add(rb); rt.Panels.Add(rp); rc.Tabs.Add(rt); } /// <summary> /// 获得菜单控制 /// </summary> /// <returns></returns> public static RibbonControl RibbonControl() { if (Autodesk.Windows.ComponentManager.Ribbon == null) Autodesk.Windows.ComponentManager.ItemInitialized += new EventHandler<RibbonItemEventArgs>(ComponentManager_ItemInitialized); return ComponentManager.Ribbon; } /// <summary>
...............
|
|