I’m new learner in C# and i have a simple problem.
I do classic loop of 15 iterations with a Threat.Sleep of 3 secondes in each ones and inside this loop at each iteration i’m addind text to my RichTextBox.
BUT the text only appear at the end of the 15 iterations of 3 secondes ! 🙁
I want the text to be added at each iteration in the loop 🙂 Is there a way to do that ?
Thank you for helping 🙂
AMIGA RULEZ
>Solution :
I tested this code and it worked.
When i press the button, the RTB adds the word "hello" each 3 seconds.
private async void button1_Click(object sender, EventArgs e)
{
for(int i=0; i<16; i++)
{
richTextBox1.Text += "hello";
await Task.Delay(3000);
}
}