How to set checkbox.isChecked without raising event

后端 未结 1 1368
伪装坚强ぢ
伪装坚强ぢ 2021-02-12 06:58

Is there a way of checking the CheckBox without running the code associated to checking it? Just for visual appearance.

Edit:

private void n         


        
相关标签:
1条回答
  • 2021-02-12 07:20

    One way would be to detach the event handler, set the IsChecked property, and then reattach it.

    myCheckbox.Checked -= myCheckbox_Checked;
    myCheckbox.IsChecked = true;
    myCheckbox.Checked += myCheckbox_Checked;
    
    0 讨论(0)
提交回复
热议问题