How to enable a button when a user types into a textbox

后端 未结 6 576
礼貌的吻别
礼貌的吻别 2020-12-25 15:06

What is the simplest way in WPF to enable a Button when the user types something into a TextBox?

6条回答
  •  忘掉有多难
    2020-12-25 15:40

    Add a callback to the TextBox that fires on every stroke. Test for emptiness in such callback and enable/disable the button.

提交回复
热议问题