如何在 Windows 窗体中创建窗体模式? [英] How do I make a form modal in Windows Forms?

查看:31
本文介绍了如何在 Windows 窗体中创建窗体模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个子表单,帮助用户为父表单中的字段输入数据.我希望这个子表单是模态的,但是我需要做什么才能使这个表单成为模态?

I'm trying to create a child form that helps the user to enter data for a field in the parent form. I want this child form to be modal, but what do I need to do to make this form modal?

我需要使用其他类型的物品吗?

Is there's a different type of item I need to use?

推荐答案

使用 <代码>Form.ShowDialog()

正如 Bob 提到的,您应该设置 Form.DialogResult 相应地在您的模态表单上.

As Bob mentioned, you should set Form.DialogResult accordingly on your modal form.

这篇关于如何在 Windows 窗体中创建窗体模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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