How to control the Visibility of a textbox with radio button “IsChecked” property?

前端 未结 1 675

How to control the Visibility of a textbox with radio button \"IsChecked\" property?

I have a Two textbox\'s let say txtbox1 and txtbox2 and I want to bind the visib

相关标签:
1条回答
  • 2020-12-13 15:14

    Yes, you can use the built-in BooleanToVisibilityConverter.

    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="b2v" />
    </Window.Resources>
    ...
    <TextBox Visibility="{Binding IsChecked,ElementName=radioBtn,Converter={StaticResource b2v}}" />
    
    0 讨论(0)
提交回复
热议问题