Kasun Perera

Kasun Perera

  • NA
  • 1
  • 1.5k

Display few text boxes one by one with delay

Feb 27 2013 8:16 AM
I'm a beginner with C#. I'm developing a web application using C#.net(Visual Studio 2010).
My question is, When I click a button, I need to display some text boxes in a web form one by one keeping some delay.
I have typed in the button click event like this;
        textBox1.Text = C1.ToString();
        Thread.Sleep(5000);
        

        textBox2.Text = C2.ToString();
         Thread.Sleep(5000);

        textBox3.Text = C3.ToString();
         Thread.Sleep(5000);

        textBox4.Text = C4.ToString();
   
Here C1,C2,C3,C4 are integer variables which stored some values.     
The output displays all 4 textboxes at once after (5000*3)=15000 time period(after 15 seconds).
But actually I need them to display one by one after every 5 seconds.
When I press the button, the
textBox1 should display and the textBox2 should display after 5 second.
How can I do like that? Please help me..