Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 37704
  • Last Modified:

How do delay(sleep) in VB.NET?

How do delay(sleep) in VB.NET?
0
LearnITvn
Asked:
LearnITvn
  • 3
  • 3
  • 2
  • +1
1 Solution
 
gregoryyoungCommented:
System.Threading.Thread.Sleep(milliseconds)

0
 
LearnITvnAuthor Commented:
Thanks gregoryyoung
see again
0
 
mpantanaCommented:
System.Threading.Thread.CurrentThread.Sleep(milliseconds)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
gregoryyoungCommented:
why "CurrentThread" mpantana ? Sleep is a static method of the thread class that suspends whateever thread it is called from.
0
 
mpantanaCommented:
Just giving options...
0
 
gregoryyoungCommented:
its not an option as you say it ...

public class foo {
    public static bar() { Console.Writeline("test"); }
}

now if I call foo.bar() it is no different than if I say foo f = new foo(); f.bar(); ... correct ?
0
 
mpantanaCommented:
...okay...bottom line, either way will work
0
 
LearnITvnAuthor Commented:
what happen???
0
 
cloud_blue_sky14Commented:
I am creating an application that requires the user to press and hold their left mouse button.  While the left mouse button is pressed, I'd like a rapid mouse click event to happen.  EX: The code would simulate the user clicking and releasing their left mouse button, while the left mouse button is being held down.  When the user releases the left mouse button, the simulated clicking would stop.  Also, I would like to setup a delay between the clicks.  Is this possible? I am using Visual Basic 2008

Thanks in advance for your help and suggestions
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now