I've got a MDI-Application in which I'd like to use modal dialogs...yes, I know that this is a little against the principles if MDI...anyway, my main window is more of a 'workspace' then anything else.
Back to topic, how can I wait for an MDI-Child to close? Some example code:
public void DoSomething() {
String searchterm = this.TextBox1.Text;
MyItem result = MySearchForm.GetItem(searchterm);
if(MyItem != MyItem.Empty) {
// do something
}
}
MySearchForm is a MDI-Child of the main window, so I can't use ShowDialog(), but I'd still like to use a blocking method to wait for the window to close and return the result. I thought about calling it on another thread and wait for that one to exit, but that also doesn't work with MDI.
Does somebody have an idea?