开发者

Preventing event from one from to another

开发者 https://www.devze.com 2023-02-22 19:45 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消