I want to set the default property of a checkbox to true
I suppose you only mean that on opening a form, one or more check boxes are checked .
Simply write in the Form_Load
method
private void Form_Loaded (object sender, RoutedEventArgs e) {
CheckBox1.IsChecked = true;
}
chkEntregue.CheckState = CheckState.Checked;
Set the Checked property to True in the Properties window of Visual Studio at design time.
To set CheckBox:
CheckBoxName.SetCurrentValue(CheckBox.IsCheckedProperty, true);
To unset CheckBox:
CheckBoxName.SetCurrentValue(CheckBox.IsCheckedProperty, false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With