Results 1 to 3 of 3

Thread: pausing after a command

  1. #1

    Thread Starter
    Addicted Member Beasts's Avatar
    Join Date
    Oct 2006
    Posts
    147

    pausing after a command

    Hi.
    i have this problem.
    i dont know how to explain this but it is like this

    DoFirstCommand();
    Wait();
    DoSecondCommand();

    its like wait for a few seconds after DoFirstCommand before processing the second one... sort of pause.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: pausing after a command

    You can call Thread.Sleep if you don't mind the whole thread freezing. If it's your UI thread then that may be an issue. Otherwise you can just start a Timer and call the second method from its Tick event.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: pausing after a command

    You could also consider using a BackgroundWorker, but the timer seems most suitable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width