c#创建一个MenuItem快捷菜单,添加的引用位置正确,然后在调试的时候出现异常引发的异常:“System.IO.FileNotFoundException”(位于 System.s.Forms中)Window
这是创建代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
[assembly:CommandClass(typeof(WindowsFormsApplication4.Form1))]
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void mi1_Click(object sender, EventArgs e)
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
doc.SendStringToExecute("Line\n", true, false, true);
}
private void mi2_Click(object sender, EventArgs e)
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
doc.SendStringToExecute("Circle\n", true, false, true);
}
private void ce_Click(object sender, EventArgs e)
{
ToolStripMenuItem windowMenu = new ToolStripMenuItem();
}
private static void Show(Point mousePosition)
{
throw new NotImplementedException();
}
}
}