You can only access User Interface (or UI) components from the thread they were created on: the UI thread. If you try to access them from a different thread, you will get this error.
The solution is to Invoke the control instead.
Fore exampole, suppose you want to add a new Tab to a Tabpage from a background thread. All you have to do is check, and invoke as necessary:
private void AddNewTab(string tabName)
{
if (InvokeRequired)
{
Invoke(new MethodInvoker(delegate { AddNewTab(tabName); }));
}
else
{
TabPage tp = new TabPage(tabName);
myTabControl.TabPages.Add(tp);
}
}