TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arun Kurmi
NA
104
103.5k
C# Radiobutton
Mar 1 2013 8:50 AM
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 = "";
}
}
}
}
Reply
Answers (
4
)
c# code for linking textbox in 1form radiobutton in 2nd form
unable to get percentage in decimal values ?