bool isChecked = false;
        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton radioButtonA = (RadioButton)sender;
            isChecked = radioButtonA.Checked;
        }

        private void radioButton1_Click(object sender, EventArgs e)
        {
            RadioButton radioButtonA = (RadioButton)sender;

            if (radioButtonA.Checked && !isChecked)
                radioButtonA.Checked = false;
            else
            {
                radioButtonA.Checked = true;
                isChecked = false;
            }
        }

 

 

接下來 就看 幾個Contral 要用

            this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
            this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click);

            this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
            this.radioButton2.Click += new System.EventHandler(this.radioButton1_Click);

 

要用自己++ 以此類推 

 

文章標籤
全站熱搜
創作者介紹
創作者 wtao015 的頭像
wtao015

心之地

wtao015 發表在 痞客邦 留言(2) 人氣(11)