C# | Making a wait function? RRS feed

  • Question

  • Timers aren't very practical in my opinion.

    What I want to be able to do would be something like this:

    wait(2000); //2000 being milliseconds

    progressBar1.Visible = false;

    button2.Visible = true;

    Is this possible?

    If so, how can I do it?

    Monday, July 29, 2019 10:20 PM


All replies

  • System.Threading.Thread.Sleep(2000);

    • Marked as answer by MojiPPT Tuesday, July 30, 2019 1:04 AM
    Monday, July 29, 2019 11:21 PM
  • How did I not know this existed? Thank you!

    I just have one question: How can I put this in a method to make it word as described in the original post?

    I can't do that normally because i'd need to make it take one arg.

    • Edited by MojiPPT Tuesday, July 30, 2019 1:09 AM Punctuation.
    Tuesday, July 30, 2019 1:08 AM