Preventing event from one from to another
I have a form that pops up in my application. When开发者_StackOverflow the form is in process of closing, the user can click on the form and the event is handled by the main application when the form is finally closed.
Is there a way to prevent any events from being recieved by the main form unless the pop-up form is closed and no longer visible?
Cursor.Current = Cursors.WaitCursor;
... Do some work...
RbForm form = new RbForm(Steps);
form.ShowDialog();
form.Dispose();
... Do some more work.... [**]
Cursor.Current = Cursors.Default;
[**] Clicking on the form here will trigger an event on the main application window once the form is closed.
Thanks.
You don't need to.
ShowDialog
shows the form modally, so that no other forms in your application will receive any input until the dialog is closed.
精彩评论