问题
I know for a button, I can do this:
this.button1.Click += new System.EventHandler(this.button_Click);
But how can I do it for a radio button?
回答1:
How about:
radioButton1.Click += new RoutedEventHandler(radioButton1_Click);
private void radioButton1_Click(object sender, RoutedEventArgs e)
{
}
回答2:
this.button1.Checked += ...
this.button1.Unchecked += ...
来源:https://stackoverflow.com/questions/4780193/adding-a-click-event-handler-programmatically-to-a-radio-button