日期:2014-05-18 浏览次数:23456 次
//使用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;
}
}
}
------解决方案--------------------
3楼方法正解。帮你顶一个
------解决方案--------------------
其实给按钮加两张图片就行,两张图片轮换着用。。
------解决方案--------------------
以前学VB时,遇到这种问题就是按5楼说的那样做的。
------解决方案--------------------