[C#][WPF] ラジオボタンの選択に応じて有効、無効を切り替える。

C#

概要

任意のラジオボタンが選択されたとき、テキストボックスやボタン等のコントロールの有効(Enable)、無効(DisEnable)を切り替えたい。

ソース

ビュー(XAML)のみで実現するので、XAMLのみです。

XAML

動作イメージ


RadioButton01がチェックされているとき、テキストボックスがEnabled。
RadioButton03がチェックされているとき、ボタンがEnabled。
RadioButtonは01と02、及び、03と04がそれぞれ同じグループです。


RadioButton01のチェックが外れると、テキストボックスがDisEnabled(IsEnabled = false)。


RadioButton03のチェックが外れると、ボタンがDisEnabled(IsEnabled = false)。

課題

ラジオボックスがFalseの時にIsEnableをTrueにするにはどうすれ良いでしょう・・・・(要調査)

ValueConverterを使えば実現できるのでしょうか・・・?

[] .net 3.5 – How to bind inverse boolean properties in WPF? – Stack Overflow

How to bind inverse boolean properties in WPF?
What I have is an object that has an IsReadOnly property. If this property is true, I would like to set the IsEnabled property on a Button, ( for example ), to ...

item: None

$tagSerchWord

// PHPのテストをしています。 //

C#WPF
Yoshi1123をフォローする
Invisible Works

コメント

タイトルとURLをコピーしました