111,077
社区成员




//使用radiobutton替找可以达到同样的效果
public partial class Form1 : Form
{
//按下状态标识
private bool m_btnState;
public Form1()
{
InitializeComponent();
//将radiobutton设为按钮形式
this.radioButton1.Appearance = System.Windows.Forms.Appearance.Button;
this.radioButton1.Checked = false;
this.m_btnState = this.radioButton1.Checked;
}
//点击时切换接下状态
private void radioButton1_Click(object sender, EventArgs e)
{
if (m_btnState == false)
{
this.radioButton1.Checked = true;
this.m_btnState = true;
}
else
{
this.radioButton1.Checked =false;
this.m_btnState=false;
}
}
}