i have simple code: constructor:
public fList()
{
InitializeComponent();
...
Task t = new Task ( () => updateBottomStatus() );
t.Start();
}
updateBottomStatus(){
this.groupBox1.Enabled = false;
... (here is checking mail status, here some class have ~1 sec working time, well i would like to improve my app, well use tasks)
this.groupBox1.Enabled = true;
}
but when I'm debugging it i have exception style (similar):
wrong operation between threads to control "groupBox" is accessed from a thread other than the thread it was created.
how i can make access near windows form controls in tasks?