vb.net表单..一次只能启用一个表单 [英] vb.net forms ..enable only one form at a time

查看:105
本文介绍了vb.net表单..一次只能启用一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须表单..当我单击form1中的按钮时,第二个表单form2应该显示。但我不能在关闭form2之前选择form1。我怎么能这样做?

I have to forms.. when I click a button in form1 the second form form2 should show. but I should not be able to select form1 before closing form2 . how can I do that?

推荐答案

只需创建新实例,并使用ShowDialog代替Show:

Just create the new instance, and use ShowDialog instead of Show:
Dim fs As New frmSecond()
fs.ShowDialog()

在frmSecond实例关闭之前,原始表单将不执行任何操作。

The original form will do nothing until the frmSecond instance is closed.


这篇关于vb.net表单..一次只能启用一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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