hi friends,
Below code run but never provide result on label.
And one more thing how to use these six radiobutton in below code without groupbox.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace msg
{
public partial class Radioibutton : Form
{
string str1;
string str2;
public Radioibutton()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "Your College is :" + str1 + " And Your Course is :" + str2;
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked)
{
str1 = radioButton1.Text;
}
else
{
str1 = "";
}
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (radioButton2.Checked)
{
str1 = radioButton2.Text;
}
else
{
str1 = "";
}
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
if (radioButton3.Checked)
{
str1 = radioButton3.Text;
}
else
{
str1 = "";
}
}
private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
if (radioButton5.Checked)
{
str2 = radioButton5.Text;
}
else
{
str2 = "";
}
}
private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
if (radioButton4.Checked)
{
str2 = radioButton4.Text;
}
else
{
str2 = "";
}
}
private void radioButton6_CheckedChanged(object sender, EventArgs e)
{
if (radioButton6.Checked)
{
str2 = radioButton6.Text;
}
else
{
str2 = "";
}
}
}
}