基于其他控件(文本框和组合框)禁用复选框状态 [英] Disabling State of Checkbox based on other controls(TextBox & ComboBox)

查看:99
本文介绍了基于其他控件(文本框和组合框)禁用复选框状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在WPF中有一个窗口,其中包含这些实体,双面打印复选框,页数,文本框和组合框选择以及用于打印的按钮,
让我们假设基于复选框的选择,用户需要禁用文本框.即,在复选框处于选中状态(true)时,我将通过使用IValueConverter使用布尔型逆变器逻辑禁用文本框和组合框.相对于Checkbox的TextBox和ComboBox实现)

但除此之外,
查询1.当用户已经更改了上述已实现的文本框/组合框中的内容时,如果我也需要禁用复选框(该复选框为未选中状态)怎么办?因此,在用户选中复选框"的检查"选项之后,禁止单击打印按钮"的后续操作.

查询2.如何有效地处理类似于ComboBox"IsSelectionChanged"的TextBox内容更改状态,即,是否有其他功能可以更改TextBox中的内容?

在此先感谢...

问候,
Samanth_90

Hi,


I have a window in WPF, which hv, these entities, Duplex printing Checkbox, No. of Pages Textbox & ComboBox Selections and Button for Print,
Let us assume, based on Checkbox selection the user needs to disable the Textbox., ie., on Checkbox checked state(true), I will disable the Textbox and ComboBox using the Boolean Inverter logic ., by usage of IValueConverter.(Already existing implemented for TextBox and ComboBox relative to Checkbox)

But in addition,
Query 1. What if I need to disable the Checkbox too(ie., Checkbox is UnChecked State), when contents in Textbox/Combo Box already implemented as above are changed by user. So that subsequent operation on click of Print Button is forbidden after Check option on Checkbox by user.

Query 2. How to effectively handle the TextBox Contents change status analogous to ComboBox "IsSelectionChanged" ie., Is there any other functionality for Change of contents in TextBox ?

Thanks in Advance...

With Regards,
Samanth_90

推荐答案

您可以尝试将Styles与MultiTriggers一起使用,或为MulitBinding构建自己的转换器.问题有点令人困惑时,很难给您一个很好的答案.
You could try using Styles with MultiTriggers, or building your own converters for a MulitBinding. It''s a bit hard to give you a good answer when the question''s a bit confusing.


这篇关于基于其他控件(文本框和组合框)禁用复选框状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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