ShowDialog and Hide form, when from is called from other object in VS2010
- by Piotr Dabrowski
Hallo,
I have a modal Form, used for searching information in DB. This Form is used by a COM object, that waits for search result. Initialization of the form take a lot of time (because of building connection to DB). So, I initialize the Form (without showing it), and keep Form-object alive, as long as COM-object work. In this way I keep the state of the Form:
public void Search()
this.ShowDialog();
string result = this.ResultOfSearch;
this.Hide()
return result;
And it doesn't work anymore on VS2010 (compiled for Framework 2.0). I search for alternative way to make a modal form (or a method to protect a form against Destroy() at the end of ShowDialog).
Any ideas?