- I want to use C# develop autocad and I build a new windows form project and add a button on it, I will put the parameter in the form.
The question is: I want to write code below the click button to call the method in another class
private void guocheng1_Click(object sender, EventArgs e) { MyCommands myMyCommands = new MyCommands(); MyCommands.Myds = new Myds() ; } public void Myds() // This method can have any name { // Put your command code here Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; ed.WriteMessage("\r\nThis is an Initialization Startup text."); }
I don't know what's wrong.
myMyCommands.Myds();. You're not trying to construct anything at that point, right?