用户控件上的模态对话框 [英] Modal dialog box on a user control

查看:77
本文介绍了用户控件上的模态对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的要求是,在对用户控件执行操作时弹出一个模态对话框,它应该只阻止用户控件而不是主窗口。

例如,MainWindow有一个带有许多选项卡项的TabControl,每个选项卡项都有一个自定义UserControl。在对用户控件执行操作时(属于选项卡),将显示模式对话框。但是此对话框不应阻止用户单击其他控件,如其他选项卡或其他控件。

那么我们如何限制对话框的形态?

请让我知道你的输入



谢谢。

Hello all,

My requirement is, pop-up a modal dialog box on performing action on a user control and it should block only the user control instead of main window.
For ex, MainWindow has a TabControl with many tab items and each tab item has a custom UserControl. On performing actions on a usercontrol(Belongs to a tab ), modal dialog box shall be displayed.But this dialog box should not block user from clicking on other controls like other tab item or some other control.
So how can we restrict the modality of dialog box?
Pls let me know ur input

Thanks.

推荐答案

您的仅阻止用户控件只是意味着:它根本不是模态的。那不是很明显吗?想一想:这是不一致的要求,或者它只是没用。如果您可以将一些控件集中在主窗口上,那么该窗口可能包含您的控件。 (好吧,当显示对话框(实际上不是对话框)时,你可以简单地禁用你的控件。)



要走的路是:检查您的UI设计。



-SA
Your "block only the user control" simply means: it's not modal at all. Isn't that obvious? Think about it: this is inconsistent requirement, or it is just useless. If you can focus some control on your main window, that window may contain your control. (Well, you can simply make your control disabled when a "dialog" (it is not a dialog, actually) is shown.)

The way to go is: review your UI design.

—SA


这篇关于用户控件上的模态对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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