Home Ask Login Register

Developers Planet

Your answer is one click away!

Thomas Eikje Gjerde February 2016

If radio button is checked not working

I have four radio buttons where one is called rb_four, and when this is checked, I want something to happen. When I type the following:

if (rb_fourp.Checked)


I get an error saying: The event ToggleButton.Checked can only appear on the left hand side of += or -=. What am I doing wrong here?

For info, this is the xaml code for the radio button:

<RadioButton Name="rb_fourp" Width="150" Height="150" Checked="rb_fourp_Checked">


Doc Holliday February 2016

Checked is the name of the event that is raised when clicking the radio button.

The IsChecked property would be the value you would want to check

if(rb_four.IsChecked){ do some code  }

Post Status

Asked in February 2016
Viewed 1,163 times
Voted 8
Answered 1 times


Leave an answer

Quote of the day: live life