.NET Compact Framework - 不带 ShowDialog 的模态表单

发布于 2024-10-03 02:17:08 字数 133 浏览 0 评论 0原文

有没有一种方法可以在不调用 ShowDialog 方法的情况下显示模式表单?通过显示模态表单,我的意思是该表单覆盖当前表单并阻止用户输入空白表单。要显示的表单是非全屏的 MessageBox 样式表单。

谢谢多米尼克

Is there a way to show a modal form without ShowDialog metod calling? By showing a modal form I mean that the Form overlays the current Form and prevent user input to the bacground Form. The Form that is to be shown is a MessageBox style form that is not fullscreen.

Thanks

Dominik

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满地尘埃落定 2024-10-10 02:17:08

我假设您可以将“对话框”表单设置为保留在顶部(TopMost 属性),然后禁用主表单以防止输入。

这只是部分解决方案,因为主窗体仍然能够聚焦、关闭等。您需要自己处理所有这些情况以防止它们发生。

您不想使用 ShowDialog 有什么特殊原因吗?

I would assume that you could set the "dialog" form to stay on top (TopMost property) and then disable the main form in order to prevent input.

This is only a partial solution as the main form will still be able to be focused, closed etc. You will need to handle all these cases yourself in order to prevent them.

Is there any particular reason you don't want to use ShowDialog?

两仪 2024-10-10 02:17:08

你可以尝试这样做:

    MyForm frm = new MyForm();  // this would be your modeless dialog
    frm->show(this);           // "this" being the instance that invokes it.

You could try to do this:

    MyForm frm = new MyForm();  // this would be your modeless dialog
    frm->show(this);           // "this" being the instance that invokes it.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文