Answers for "a infinite loop in text box update ui c#"

C#
0

a infinite loop in text box update ui c#

private void button1_Click(object sender, EventArgs e)
{
    EndlessTask();
}
async Task EndlessTask()
{
    for(int i = 0; true; i++)
    {
        textBox1.Text = i.ToString();
        await Task.Delay(500);
    }
}
Posted by: Guest on October-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language