1 year ago

#148023

test-img

Matto58

Is there a sleep function for C# without bugging out my Visual Studio 2022 app UI?

I have been looking all over Stack Overflow, Google and W3schools and didn't find a sleep or wait function which doesn't bug out my UI.

Task.Wait or Task.Delay both bug out my UI by replacing every object with a white rectangle.

Here's the code:

Task t = Task.Run(async delegate
    {
        OS.label1.Text = Translation.EN_US.SetupLoading;
        centerLabel(OS.label1);
        await Task.Delay(20000);
        return 42;
    });

Note: I am a beginner programmer who's been programming for 3 years

c#

wait

sleep

thread-sleep

visual-studio-2022

0 Answers

Your Answer

Accepted video resources