Nope, that won't work as this is being called in a class that isn't a form at all.
I've also tried:
- setting the location off the screen (-3200,-3200)
- setting the size to zero
- locking the MDI parent form using ScreenLock
- minimizing the form
- calling visible before show
- Hiding the form in the VisibleChanged event
Nothing worked. In every case, there is a brief moment when the form is shown before going away.
I'm still curious if this can be done, so if anyone has any thoughts I'd love to hear them!
However, my understanding of garbage collection wasn't complete. I assumed that the parent form would stick around after the search form was closed. Then I got the brilliant idea to actually test this and put a breakpoint in the dispose method (hey what can I say...apparently both brain cells are active today). Turns out that when the search form is closed, before the main form has been shown, it is disposed of immediately! There was no problem to solve! DOH!
Thanks for your help though, Edhy. It did get me thinking, which lead to some google searches that lead to the other brain cell firing.