开发者

wpf - how should I auto-grey-out a textbox when it's associated radiobutton is not selected?

开发者 https://www.devze.com 2023-01-15 19:39 出处:网络
What\'s the best approach to auto-grey-out a textbox if it\'s ass开发者_运维百科ociated radiobutton is not selected?

What's the best approach to auto-grey-out a textbox if it's ass开发者_运维百科ociated radiobutton is not selected?

I've got an open question out re using a dependency property (which I haven't got working) for this, however I'm not sure this is the appropriate approach. So basically when RadioButton 1 is selected the text field is enabled, however when RadioButton 2 is selected then the textfield should got NOT enabled.


<RadioButton x:Name="RadioButton2" />
<TextBox IsEnabled="{Binding IsChecked, ElementName=RadioButton2}" />
0

精彩评论

暂无评论...
验证码 换一张
取 消