Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
Questionbarcode Pin
k36madman29-Sep-07 8:12
k36madman29-Sep-07 8:12 
AnswerRe: barcode Pin
martin_hughes29-Sep-07 10:15
martin_hughes29-Sep-07 10:15 
GeneralRe: barcode Pin
k36madman29-Sep-07 12:02
k36madman29-Sep-07 12:02 
GeneralRe: barcode Pin
martin_hughes29-Sep-07 12:31
martin_hughes29-Sep-07 12:31 
GeneralRe: barcode Pin
k36madman29-Sep-07 14:39
k36madman29-Sep-07 14:39 
GeneralRe: barcode Pin
GuyThiebaut30-Sep-07 8:25
professionalGuyThiebaut30-Sep-07 8:25 
GeneralRe: barcode Pin
k36madman30-Sep-07 10:43
k36madman30-Sep-07 10:43 
QuestionRadio Buttons Pin
picasso229-Sep-07 7:52
picasso229-Sep-07 7:52 
1. added and initialized some components, including radio buttons
// Create and initialize a GroupBox and a radio Button control.
GroupBox groupBox1 = new GroupBox();
RadioButton radio1 = new RadioButton();
RadioButton radio2 = new RadioButton();
groupBox1.Size = new Size(100,100);
groupBox1.Location = new Point(4,24);
groupBox1.FlatStyle = FlatStyle.System;
groupBox1.Text = "Engin";

radio1.Location = new System.Drawing.Point(8,24);
radio1.Size = new Size(50,20);
radio1.Text = "radio1";
radio1.Name="cb9";

radio2.Location = new System.Drawing.Point(8,64);
radio2.Size = new Size(50,20);
radio2.Text = "radio2";
radio1.Name="cb10";



groupBox1.Controls.Add(radio1);
groupBox1.Controls.Add(radio2);

2. in the button click function, added following to detect state

private void btnPF_Click(object sender, EventArgs e)
{

//DETECTING components
foreach(Control c in panel1.Controls)
if (c.Name.Equals("cb1"))
{
CheckBox lb = c as CheckBox;

if (lb.Checked)
{
//MessageBox.Show("cb1 checked", "info");

}
}






else if (c.Name.Equals("cb9"))
{


RadioButton lb = c as RadioButton;

if (lb.Checked)
{
//MessageBox.Show("radio1 checked", "info");

}
}
else if (c.Name.Equals("cb10"))
{


RadioButton lb = c as RadioButton;

if (lb.Checked)
{
//MessageBox.Show("radio2 checked", "info");

}
}




All of the components are detected properly but not the radio buttons

any help is greatly appreciated

AnswerRe: Radio Buttons Pin
Lutosław29-Sep-07 8:59
Lutosław29-Sep-07 8:59 
QuestionObject reference not set to an instance of an object. Pin
anydie29-Sep-07 7:20
anydie29-Sep-07 7:20 
AnswerRe: Object reference not set to an instance of an object. Pin
Luc Pattyn29-Sep-07 7:55
sitebuilderLuc Pattyn29-Sep-07 7:55 
AnswerRe: Object reference not set to an instance of an object. Pin
Guffa29-Sep-07 7:57
Guffa29-Sep-07 7:57 
QuestionxmlTextReader [modified] Pin
jon-8029-Sep-07 6:46
professionaljon-8029-Sep-07 6:46 
Questionimage DBNull Pin
TAREQ F ABUZUHRI29-Sep-07 6:19
TAREQ F ABUZUHRI29-Sep-07 6:19 
AnswerRe: image DBNull Pin
Christian Graus29-Sep-07 11:33
protectorChristian Graus29-Sep-07 11:33 
Question.NET arbitrary precision arithmetic library Pin
thepersonof29-Sep-07 5:55
thepersonof29-Sep-07 5:55 
AnswerRe: .NET arbitrary precision arithmetic library Pin
thepersonof29-Sep-07 8:01
thepersonof29-Sep-07 8:01 
GeneralRe: .NET arbitrary precision arithmetic library Pin
Luc Pattyn29-Sep-07 8:07
sitebuilderLuc Pattyn29-Sep-07 8:07 
QuestionRegarding regular expressions Pin
anu8129-Sep-07 0:22
anu8129-Sep-07 0:22 
AnswerRe: Regarding regular expressions Pin
S. Senthil Kumar29-Sep-07 6:43
S. Senthil Kumar29-Sep-07 6:43 
QuestionI need help really!!!! Pin
chanzeb28-Sep-07 23:49
chanzeb28-Sep-07 23:49 
AnswerRe: I need help really!!!! Pin
Guffa29-Sep-07 0:05
Guffa29-Sep-07 0:05 
GeneralRe: I need help really!!!! Pin
Christian Graus29-Sep-07 0:27
protectorChristian Graus29-Sep-07 0:27 
GeneralRe: I need help really!!!! Pin
chanzeb29-Sep-07 0:34
chanzeb29-Sep-07 0:34 
QuestionIcon resource causing compile error Pin
DaveyM6928-Sep-07 23:24
professionalDaveyM6928-Sep-07 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.