How to Enable/Disable button in wpf

前端 未结 5 372
温柔的废话
温柔的废话 2021-01-02 10:51

I Have 2 button , Start And capture. I want disable capture button on form load and enable start. and on after click on start disable start button and enable capture. Pleas

5条回答
  •  粉色の甜心
    2021-01-02 11:29

    There are two ways to disable a button In C# WPF.

    1. In .xaml File
      Using IsEnabled="False". If you set False to IsEnabled attribute, then your button will be disabled by default.
    2. In .cs File
      ButtonName.IsEnabled = false; If you set IsEnabled property as false for the button, it will disable the button

提交回复
热议问题