下面是我根据autodesk系列产品开发教程 写的一段代码,我想往AutoCAD2008中加菜单,但怎么加不上? 请高手帮我看看! using System; using System.Collections.Generic; using System.Text; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Windows; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Geometry; using System.Windows.Forms; namespace cl { class Class2Menu { [CommandMethod("Addmenu")] public void Addmenu() { AddContextMenu(); } public ContextMenuExtension m_ContextMenu; private void AddContextMenu() { m_ContextMenu = new ContextMenuExtension(); m_ContextMenu.Title = "工程图系统"; Autodesk.AutoCAD.Windows.MenuItem mi; mi = new Autodesk.AutoCAD.Windows.MenuItem("用户管理"); mi.Click += MenuUserM_OnClick; m_ContextMenu.MenuItems.Add(mi); Autodesk.AutoCAD.ApplicationServices.Application.AddDefaultContextMenuExtension(m_ContextMenu); } private void MenuUserM_OnClick(object Sender, EventArgs e) { MessageBox.Show("用户管理"); } } } |