My app has a main form. The form has a button which hides the main form and then tries to create a HttpWebRequest to get some info. While the (synchronous) webrequest resolves and connects, I'd like to display a smaller non-modal form with no controls except for a label that states that something is actually happening.
Now, after hiding the main form I instantiate a new form and make it look right with the label and no controlboxes etc. I then call theForm.Show(); .. And duh, the form doesn't show up right. Windows draws a new empty window frame, size being what I wanted to, but it seems broken and has nothing in it. Once the webrequest stuff is processed, my code disposes of the little form and continues as ever.
theForm.ShowDialog(); seems to be blocking, so I wouldn't want to use that. I can of course create a new thread, but I guess I'm just doing something wrong here.
I also managed to show the form by creating a new thread for it, and displaying the form by calling Application.Run(theForm); ..
So what gives, why doesn't the simple .Show() work? Does every form need a thread of its own or something like that?
Now, after hiding the main form I instantiate a new form and make it look right with the label and no controlboxes etc. I then call theForm.Show(); .. And duh, the form doesn't show up right. Windows draws a new empty window frame, size being what I wanted to, but it seems broken and has nothing in it. Once the webrequest stuff is processed, my code disposes of the little form and continues as ever.
theForm.ShowDialog(); seems to be blocking, so I wouldn't want to use that. I can of course create a new thread, but I guess I'm just doing something wrong here.
I also managed to show the form by creating a new thread for it, and displaying the form by calling Application.Run(theForm); ..
So what gives, why doesn't the simple .Show() work? Does every form need a thread of its own or something like that?