There are three controls on a docking pallette, one "Textbox" and tow "Button". Button2 change the TextBox's text directly, it works, Button1 do it by executing a AutoCAD command, it doesn't works. Why?
As if the rountine register to AutoCAD Command is annother thread...Is there a way to get data form routine which is registered to AutoCAD Command? I need it to interact with the dockingpallette.
Below is the code and the source file is in the attachment.:
//Button1 can not change the Textbox, but Button2 do, why? Please help.
private void button1_Click(object sender, EventArgs e)
{
AcadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("CommandName\n", true, false, false);
}
[Autodesk.AutoCAD.Runtime.CommandMethod("CommandName")]
public void aRountine()
{
// Notice, it can not change the TextBox1
this.textBox1.Text = "abc";
MessageBox.Show("this.textBox1.Text is: " + this.textBox1.Text,"Click form Button1");
}
private void button2_Click(object sender, EventArgs e)
{
this.textBox1.Text = "abc";
MessageBox.Show("this.textBox1.Text is: " + this.textBox1.Text, "Click form Button2");
}
}
Thanks for any help.