1)在窗体上布置控件
2)代码
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : 键御竖Form
{
拆樱 public Form2()
{
InitializeComponent();
button1.Focus();
}
private void button1_Click(object sender, EventArgs e)
稿大 {
radioButton1.Checked = true;
}
private void button2_Click(object sender, EventArgs e)
{
radioButton2.Checked = true;
}
private void button3_Click(object sender, EventArgs e)
{
radioButton3.Checked = true;
}
}
}
设置拍弊控销仿件的 Checked 属性为 true 就可以了。亏贺纤
rdb1.Checked = true; // 选中rdb1