返回第一个窗口之前,关闭第二个窗口窗体 [英] Closing the second windows form before returning to the first

查看:129
本文介绍了返回第一个窗口之前,关闭第二个窗口窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道,我现在有两个打开的窗体"A"和"B",我想先关闭窗体B,然后再返回窗体A.

例如,创建一个带有按钮的表单,单击按钮时它必须显示一个消息框,现在返回该表单而不关闭该消息框,请先查看该消息框如何闪烁以先关闭后再返回该表单.

我该如何使用两种形式?

Hi
I want to know, I have two windows forms "A" and "B" open now I want to close form B to be closed before returning to form A.

E.g create a form with a button, when clicking the button it must show a message box, now return to the form without closing the message box, see how the message box flashed to be closed first before returning to the form.

How do I do that with two forms?

推荐答案

只需使用ShowDialog方法而不是Show显示第二种形式-原始形式将被冻结,直到第二种形式被冻结为止.已关闭.
Just show the second form with the ShowDialog method instead of Show - the original form will be frozen until the second form is closed.


这篇关于返回第一个窗口之前,关闭第二个窗口窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆