Background Tasks
What is a Background Task?
Update the UI
void button1_Click(EventArgs e)
{
Application.StartTask(() =>
{
// Change the text of button 1 from 1 to 10 in the background.
for (int i = 0; i < 10; i++)
{
this.button1.Text = i.ToString();
// We are running out-of-bound and we need to push the updates
// to the client using Application.Update(). It can be called at any time
// and interval. It simply flushes the changed back to the client.
Application.Update(this);
Thread.Sleep(1000);
}
});
}Private Sub button1_Click(e As EventArgs)
Application.StartTask(Sub()
' Change the text of button 1 from 1 to 10 in the background.'
For i = 0 To 10
Me.button1.Text = i.ToString()
' We are running out-of-bound and we need to push the updates'
' to the client using Application.Update(). It can be called at any time'
' and interval. It simply flushes the changed back to the client.'
Application.Update(this)
Thread.Sleep(1000)
Next
End Sub)
End SubSystems Without WebSocket
Background Task with Multiple Users
Last updated
Was this helpful?

