C# 以编程方式向单选按钮添加单击事件处理程序
我知道,对于一个按钮,我可以做到:C# 以编程方式向单选按钮添加单击事件处理程序,c#,wpf,wpf-controls,C#,Wpf,Wpf Controls,我知道,对于一个按钮,我可以做到: this.button1.Click += new System.EventHandler(this.button_Click); 但是我怎样才能为一个单选按钮做到这一点呢?怎么样: this.button1.Checked += ... this.button1.Unchecked += ... radioButton1.Click += new RoutedEventHandler(radioButton1_Click); private v
this.button1.Click += new System.EventHandler(this.button_Click);
但是我怎样才能为一个单选按钮做到这一点呢?怎么样:
this.button1.Checked += ...
this.button1.Unchecked += ...
radioButton1.Click += new RoutedEventHandler(radioButton1_Click);
private void radioButton1_Click(object sender, RoutedEventArgs e)
{
}