How to validate a Radiobutton in Windows Form

Syedshakeer
Posted by Syedshakeer under Windows Forms category on | Views : 5875
Add Two radioButton on windows from.and change radiobutton text as Male and Female

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}


private void button1_Click(object sender, EventArgs e)
{
if (radioMale.Checked == true || radioFemale.Checked == true)
{
MessageBox.Show("Thanks for selecting");
}
else
{
MessageBox.Show("plz select Male Or Female");
}
}
}
}

Comments or Responses

Login to post response