:-) have you followed the example in the link supplied
in order to access a UI control from another thread, you need to invoke that control, an example on how to do this is given in the link
so in your case you may wish to do this.
//main form
public delegate void MyTextBoxDelegate(bool enable);
..
..
public void DoEnableTextBox(bool enable)
{
if (this.theTextBox.InvokeRequired)
{
MyTextBoxDelegate theDelegate = new MyTextBoxDelegate(this.DoEnableTextBox);
this.Invoke(theDelegate, new object[] { enable });
}
else
{
this.theTextBox.Enabled = enable;
}
}
usage:
call from the other thread:
DoEnableTextBox(true); //true or false, whichever you want to use
|