You cannot have a procedure inside another procedure. Meaning, you cannot contain void button1_Click inside radioButton1_CheckedChanged . You would have to use some sore of boolean logic to determine which radio button was selected or not.