简体   繁体   English

.NET Compact Framework - 没有ShowDialog的模式窗体

[英].NET Compact Framework - modal Form without ShowDialog

Is there a way to show a modal form without ShowDialog metod calling? 有没有办法在没有ShowDialog metod调用的情况下显示模态形式? By showing a modal form I mean that the Form overlays the current Form and prevent user input to the bacground Form. 通过显示模态表单,我的意思是表单覆盖当前表单并阻止用户输入bacground表单。 The Form that is to be shown is a MessageBox style form that is not fullscreen. 要显示的表单是不是全屏的MessageBox样式表单。

Thanks 谢谢

Dominik 多米尼克

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. 我假设您可以设置“对话框”表单以保持在顶部(TopMost属性),然后禁用主窗体以防止输入。

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? 您是否有任何特殊原因想要使用ShowDialog?

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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM