Answers for "how to set value for radio button in c#"

1

c# sharp radio button in html how to

using System;
using System.Drawing;
using System.Windows.Forms;

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

        private void Form1_Load(object sender, EventArgs e)
        {
            radioButton1.Checked = true;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                MessageBox.Show ("You are selected Red !! ");
                return;
            }
            else if (radioButton2.Checked == true)
            {
                MessageBox.Show("You are selected Blue !! ");
                return;
            }
            else
            {
                MessageBox.Show("You are selected Green !! ");
                return;
            }
        }
    }
}
Posted by: Guest on July-22-2020
0

c# reset radio button list on click

myRadioButtonList.SelectedIndex = -1;
Posted by: Guest on October-21-2020

Code answers related to "how to set value for radio button in c#"

Browse Popular Code Answers by Language