Sunday, 27 September 2009

For Loop to display user input in C#

In this example, when 'button3' is pressed the application will read what has been added to 'textBox1' and print it the console each time it loops through.
private void button3_Click(object sender, EventArgs e)

{

for (int i = 1; i <=10; ++i)

{

System.Console.WriteLine (textBox1.Text);

}

}

No comments:

Post a Comment