I encounter a problem with a Windows Forms application.
A form must be displayed from another thread. So in the form class, I have the following code:
I also think SLaks is correct. From msdn (http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invokerequired.aspx):
If no appropriate handle can be found, the InvokeRequired method returns false.
If its possible in your case, I would try to combine the creating and showing the control in a single method, i.e.:
public DisplayDialog static Show()
{
var result = new DisplayDialog; //possibly cache instance of the dialog if needed, but this could be tricky
result.ShowDialog();
return result;
}
you can call Show from a different thread