dimanche 17 décembre 2017

if(checkbox.Checked){} issues

I am not sure why but I opened a new project and I am trying to do a simple checkbox + button + console write statement and I am getting an error. The error states: RoutedEventHandler System.Windows.Controls.Primitives.ToggleButton.Checked The event ToggleButton.Checked can only appear on the left hand side of += or -=.

I used this code before without any issues so I am not sure what's happening...

private void button_Click(object sender, RoutedEventArgs e)
    {
        if(checkBox1.Checked)
        {
          Console.Write("Checked");
        }
    }




Aucun commentaire:

Enregistrer un commentaire