>i need help with radiobuttons.
i am useing 1button and 2 radiobuttons i am trying to make it so when u
select a radiobutton and hit button1 it will clear radiobuttons 1 and 2.
//namespace RadioButton
namespace RadioButton
{
using System;
using System.Drawing;
using System.Windows. Forms;
//class Form
class Form:System.Win dows.Forms.Form
{
//create 3 RadioButtons
RadioButton radiobutton1=ne w RadioButton();
RadioButton radiobutton2=ne w RadioButton();
RadioButton radiobutton3=ne w RadioButton();
//create a Button
Button button=new Button();
//constructor
Form()
{
//set Text of the RadioButtons
radiobutton1.Te xt="RadioButto n 1";
radiobutton2.Te xt="RadioButto n 2";
radiobutton3.Te xt="RadioButto n 3";
//set Text of the Button
button.Text="Re set";
//set EventHandler for the Button
button.Click+=n ew EventHandler(Bu tton_Click);
//set Location of the RadioButtons
radiobutton1.Lo cation=new Point(34,5);
radiobutton2.Lo cation=new Point(34,26);
radiobutton3.Lo cation=new Point(34,47);
//set Location of the Button
button.Location =new Point(34,68);
//add the RadioButtons to the Form
Controls.Add(ra diobutton1);
Controls.Add(ra diobutton2);
Controls.Add(ra diobutton3);
//add the Button to the Form
Controls.Add(bu tton);
}
//Button_Click
void Button_Click(ob ject a,EventArgs b)
{
radiobutton1.Ch ecked=false;
radiobutton2.Ch ecked=false;
radiobutton3.Ch ecked=false;
}
//Main
[STAThreadAttrib ute]
public static void Main(string[] args)
{
Application.Run (new Form());
}
}
}