Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get the final program? Pin
Abhijit Jana18-Dec-08 3:10
professionalAbhijit Jana18-Dec-08 3:10 
AnswerRe: How to get the final program? Pin
benjymous18-Dec-08 3:10
benjymous18-Dec-08 3:10 
AnswerRe: How to get the final program? Pin
Tom Deketelaere18-Dec-08 3:11
professionalTom Deketelaere18-Dec-08 3:11 
AnswerRe: How to get the final program? Pin
Lev Danielyan18-Dec-08 3:11
Lev Danielyan18-Dec-08 3:11 
Answer[Message Deleted] Pin
hanxing_c18-Dec-08 3:16
hanxing_c18-Dec-08 3:16 
GeneralRe: How to get the final program? Pin
Dan Neely18-Dec-08 3:26
Dan Neely18-Dec-08 3:26 
GeneralRe: How to get the final program? Pin
Luc Pattyn18-Dec-08 3:44
sitebuilderLuc Pattyn18-Dec-08 3:44 
Questionadding stuff to labels from textboxes but creating new labels to populate as we go? Pin
Davey8518-Dec-08 0:54
Davey8518-Dec-08 0:54 
Can anyone help please!
I am trying to create a list of labels poulated from one textbox, so when i click the button it passes the code to label 1, then label 2, then label 3 etc. I have included the code for a real simple way of doing it, but i dont want a massive list of "if, else if statements", there must be an easier way. Hopefully this makes sense!


namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
label1.Text = "";
label2.Text = "";
}

private void button1_Click(object sender, EventArgs e)
{
if (label1.Text == "")
{
label2.Text = "";
string a = textBox1.Text;
label1.Text = a;

}
else if (label1.Text != "")
{
string a = textBox1.Text;
label2.Text = a;
}
}
}
}
AnswerRe: adding stuff to labels from textboxes but creating new labels to populate as we go? Pin
Expert Coming18-Dec-08 0:59
Expert Coming18-Dec-08 0:59 
GeneralRe: adding stuff to labels from textboxes but creating new labels to populate as we go? Pin
Davey8518-Dec-08 2:09
Davey8518-Dec-08 2:09 
AnswerRe: adding stuff to labels from textboxes but creating new labels to populate as we go? Pin
benjymous18-Dec-08 1:32
benjymous18-Dec-08 1:32 
AnswerRe: adding stuff to labels from textboxes but creating new labels to populate as we go? Pin
Brij18-Dec-08 1:59
mentorBrij18-Dec-08 1:59 
QuestionRegular Expression for Date Validator not working? Pin
Dinker Batra18-Dec-08 0:29
Dinker Batra18-Dec-08 0:29 
AnswerRe: Regular Expression for Date Validator not working? Pin
Dinker Batra18-Dec-08 0:32
Dinker Batra18-Dec-08 0:32 
GeneralRe: Regular Expression for Date Validator not working? Pin
Guffa18-Dec-08 0:39
Guffa18-Dec-08 0:39 
GeneralRe: Regular Expression for Date Validator not working? Pin
Dinker Batra18-Dec-08 0:48
Dinker Batra18-Dec-08 0:48 
GeneralRe: Regular Expression for Date Validator not working? Pin
Guffa18-Dec-08 1:47
Guffa18-Dec-08 1:47 
GeneralRe: Regular Expression for Date Validator not working? Pin
Dinker Batra18-Dec-08 1:57
Dinker Batra18-Dec-08 1:57 
GeneralRe: Regular Expression for Date Validator not working? Pin
Gideon Engelberth18-Dec-08 3:33
Gideon Engelberth18-Dec-08 3:33 
AnswerRe: Regular Expression for Date Validator not working? Pin
PIEBALDconsult18-Dec-08 12:16
mvePIEBALDconsult18-Dec-08 12:16 
QuestionPost-build event command line error Pin
Reddy Prakash18-Dec-08 0:13
Reddy Prakash18-Dec-08 0:13 
AnswerRe: Post-build event command line error Pin
benjymous18-Dec-08 0:16
benjymous18-Dec-08 0:16 
GeneralRe: Post-build event command line error Pin
Reddy Prakash18-Dec-08 0:23
Reddy Prakash18-Dec-08 0:23 
GeneralRe: Post-build event command line error Pin
moon_stick18-Dec-08 0:55
moon_stick18-Dec-08 0:55 
GeneralRe: Post-build event command line error Pin
benjymous18-Dec-08 1:31
benjymous18-Dec-08 1:31 

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.