WPF Checkbox check IsChecked

后端 未结 8 833
别跟我提以往
别跟我提以往 2020-12-08 10:25

I\'m not talking about an event handler for this, but rather a simple If Statement checking if the CheckBox has been checked. So far I have:

<
8条回答
  •  温柔的废话
    2020-12-08 10:51

    One line is enough to check if the radio button is checked or not:

    string status = Convert.ToBoolean(RadioButton.IsChecked) ? "Checked" : "Not Checked";
    

提交回复
热议问题