I want to load a form ufdiagram1
in the mainform as a dockpanel using another thread than the forms-thread of mainform.
With the following code I am getting a NullReferenceException
:
private UfDiagram ufdiagram1 = new UfDiagram();
privat void form1_load(...)
{
System.Threading.Thread tThread1 = new System.Threading.Thread(new System.Threading.ThreadStart(StartDiaThread));
tThread1.Name = "ufDiagram1";
tThread1.Start();
}
private void StartDiaThread()
{
ufdiagram1.Show(dockPanel1, DockState.DockRight);
//ufdiagram1.showDialog(); //Does work in a new form but not as a dockpanel
}
Is it possible to start the ufdiagram1
docked in the mainform with another thread? If so, how does that work?