.NET Compact Framework - 不带 ShowDialog 的模态表单
有没有一种方法可以在不调用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您可以将“对话框”表单设置为保留在顶部(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?
你可以尝试这样做:
You could try to do this: