请看下面的代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace calc
{
public partial class Form1 : Form
{
//code removed
public Form1()
{
InitializeComponent();
calculator = new Calculator();
maleRadio.PerformClick();
englishRadio.PerformClick();
}
/*code removed*/
//Action Listener for Female Radio button
private void femaleRadio_CheckedChanged(object sender, EventArgs e)
{
//code removed
}
//Action Listener for English Radio button
private void englishRadio_CheckedChanged(object sender, EventArgs e)
{
//code removed
}
}
}
我对 c# 有点陌生。我在这里要做的是以event handlers
编程方式触发构造函数中的单选按钮。我遵循的方式maleRadio.PerformClick();
无济于事。如何以编程方式调用构造函数中的事件处理程序?