public static void btn4_clicked(object sender, EventArgs e) { // Checks if the variable asigned to the ToolWindow is active (if the ToolWindow is allready created) if (createbox == null) { createbox = new Create_box(); } // Creates a new EventHandler to check when the createbox Dispose is raised createbox.ResetObj += new EventHandler(DisposeObj); }
// createbox Dispose is raised public static void DisposeObj(object sender, EventArgs e) { createbox = null; // when the ToolWindow us Disposed, the variable createbox is set to null. }
// The event handler for the "Create ABB box" button. static void btn4_clicked(object sender, EventArgs e) { Create_box.create_box(); //Create_box.AddCustomControl(); }