下拉列表无效和无效 [英] DropDown List Inable and Disable

查看:692
本文介绍了下拉列表无效和无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用两个控件,第一个CheckBox和第二个DropDownList.我的查询是当我选中复选框而不是启用下拉列表时.

I am using two controls first CheckBox and second DropDownList . My query is when i check checkbox than dropdown list enabled.

并且当我取消选中复选框而不是下拉列表时禁用.

and when i unchecked checkbox than dropdownlist disable.

如何使用Converter或绑定.

How its possible using Converter or binding.

请找到随附的场景图片.看看 

Please find attached  scenario Image . look at 

谢谢

Aniruddha acharya

Aniruddha acharya

A.Acharya对我们的反馈在Windows Store中开发和推广您的应用程序,如果有帮助,请记住将其标记为答案,如果没有帮助,则将其取消标记.

A.Acharya Feedback to us Develop and promote your apps in Windows Store Please remember to mark the replies as answers if they help and unmark them if they provide no help.

推荐答案

您可以将ComboBox的IsEnabled属性绑定到CheckBox的IsChecked属性,如下所示:

You could bind the IsEnabled property of the ComboBox to the IsChecked property of the CheckBox like this:

        <CheckBox x:Name="cBox" Content="Enable/Disable" />

        <ComboBox IsEnabled="{Binding IsChecked, ElementName=cBox}">
            <ComboBoxItem>1</ComboBoxItem>
            <ComboBoxItem>2</ComboBoxItem>
            <ComboBoxItem>3</ComboBoxItem>
        </ComboBox>


希望有帮助.


Hope that helps.

请记住,通过将有用的帖子标记为答案来关闭话题,然后在遇到新问题时开始新话题.请不要在同一线程中问几个问题.

Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.


这篇关于下拉列表无效和无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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