Hello,

I am wondering if there is a function in c# that will allow me to wait a certain amount of time before going on to the next procedure?

Also, I was wondering if there is a function that simulates hitting the enter button on the keyboard.

Thanks in advance.

1. You can insert a timer.
On time event should contain procedure you want to call.

2. On click (on key press) event should do the task.

example:

private void form1_KeyPress(object sender, KeyPessEventArgs e)
{
if (e.KeyChar==13) { // You should insert here code that should be executed // }

}

Do you need to make a new thread to use a timer, or can you just say

System.Threading.Timer(5000)

Thanks for the help

I am not sure for Console Apps, but in Windows Apps you have a component named timer (on WINDOWS FORMS toolbox). you shoud set interval, and in ON TICK event you should insert code.

OK, thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.