Automatically add a Click event handler to the radio button

I know for a button, I can do this:

this.button1.Click += new System.EventHandler(this.button_Click);

But how can I do this for a switch?

+3
source share
2 answers

What about:

 radioButton1.Click += new RoutedEventHandler(radioButton1_Click);


 private void radioButton1_Click(object sender, RoutedEventArgs e)
 {

 }
+7
source
this.button1.Checked += ...

this.button1.Unchecked += ...
+3
source

Source: https://habr.com/ru/post/1787397/


All Articles