即使上面有模式对话框,表单也可用
我有一个对话框 A,我希望它加载第二个对话框 B,该对话框是无模式的,并且始终保持在 A 侧。然后,对话框 A 可能会启动模式对话框 C。但是当 C 存在时,我希望 B 可用。我会在 C++ 应用程序中使用 A 中的预翻译消息来修复此问题,但 C# 中的方法是什么。
I have a Dialog A and I want it to load a second dialog B which is modeless and stays along side A throughout. Dialog A may then launch a modal dialog C. But when C is present I want B to be usable. I would have fixed this with pretranslate message in A in a C++ application but what is the approach in C#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
启动对话框 C 时,使用
yourFormVariable.Show()
而不是yourFormVariable.ShowDialog()
启动它。这将允许两个表单都处于活动状态并可供用户使用,而在以下代码中:
用户必须先关闭 form2,然后才能继续使用 form1。
请注意,不存在允许使用以前的表单的模态对话框 - 模态对话框< /a> 根据定义,用户在继续之前必须与之交互并关闭。
When you launch Dialog C, launch it using
yourFormVariable.Show()
instead ofyourFormVariable.ShowDialog()
.This will allow both forms to be active and usable by the user, whereas in the following code:
the user will have to close form2 before they can continue to use form1 again.
Note that there is no such thing as a modal dialog that allows the previous forms to be usable - a modal dialog by definition is one that the user has to interact with and close before continuing.