If statements for Checkboxes

Viewed 160728

I wanted to know how to write if statements to see if one or another check box is checked or not.

I have two check boxes. I wanted it to check to see if checkbox 1 is checked and checkbox 2 is null then call this function, and if checkbox 2 is checked and checkbox 1 is null then call another function.

Pretty bad with IF statements and not sure how to convert the checkbox into a readable value.

6 Answers

I suggest

if (checkbox.IsChecked == true)
{
    //do something
}

Hope it's helpful ^^

Related