lundi 6 août 2018

C# WPF CheckBox not enabling after disabling

i have 3 checkboxes and i want to disable/enable two of them when the other one is checked/unchecked...the first step works (if i check checkBoxcaja, the other two checkBoxes disables well, but when i uncheck checkBoxcaja, the other two checkBoxes doesn´t return to their original Enabled state. What am i doing wrong?? I´m a newbie in WPF.

this is the code:

private void checkBoxcaja_Checked(object sender, RoutedEventArgs e) {

        if (checkBoxcaja.IsChecked == true)
        {
            checkBoxbanderola.IsEnabled = false;
            checkBoxletra.IsEnabled = false;
        }
        else if (checkBoxcaja.IsChecked == false)
        {
            checkBoxbanderola.IsEnabled = true;
            checkBoxletra.IsEnabled = true;
        }

    }

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire