if(radioButton1.Checked== true) { // put your code here, such as string sex = "Male"; } if(radioButton2.checked==true) { string sex ="Female"; }
string sex = radioButton1.Checked ? "Male" : "Female";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)