A
A
Alexey Saprin2015-03-25 18:26:53
Programming
Alexey Saprin, 2015-03-25 18:26:53

C# checkbox .Checked xaml?

Hello,
you can somehow force the checkbox not to change state if the function has not been executed,
processing the click programmatically cannot change:
public void chkEv(object sender, RoutedEventArgs e){
CheckBox cb = (CheckBox)sender;
cb.Checked = true;
here comes the error Error CS0079
The event 'ToggleButton.Checked' can only appear on the left hand side of += or -=
if so how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nemiro, 2015-03-25
@0crash0

Checked is an event.
The state can be set with the IsChecked property :

CheckBox cb = (CheckBox)sender;
cb.IsChecked = true;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question