I am writing a test application where I need to put the form in a separate stream.
So, if I create a form window from the main thread and set it to .Owner = it all works. If I create a UIThread thread and install Owner from a new thread, I get an exception. Getting exceptions is understandable, since you cannot access forms directly. My question is, is there a message that I need to catch in the main thread and make BeginInvoke to push the pump message on it? Since UIForm ShowInTaskbar is set to false, I need to click the main application on the taskbar and restore all its child windows.
private void UIThread()
{
UIForm form = new UIForm();
form.ShowInTaskbar = false;
form.Owner = this;
Application.Run(form);
}
source
share