ShowModal 和 Show 的区别

Show:

Use Show to set the form Visible property to true and to bring the form to the front of other forms on the screen.

ShowModal:
Use ShowModal to show a form as a modal form.  A modal form is one where the application can continue to run until the form is closed. Thus, ShowModal does not return until the form closes. When the form closes, it returns the value of the ModalResult property.

翻译成中文大概意思是:
Show仅仅是让一个窗口显示出来,比如在Form1中让Form2->Show(),那么在Form2显示之后你还可以继续点击Form1的东西。
而ShowModal是把窗口当成模式窗口显示,意味着程序只能在这个窗口关闭以后才继续执行下面的语句,比如在Form1中让Form2->ShowModal();那么在Form2关闭之前,Form1是不可用的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值