2 questions: making a program wait, simulating the enter button

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2004
Posts: 573
Reputation: Dark_Omen is an unknown quantity at this point 
Solved Threads: 5
Dark_Omen Dark_Omen is offline Offline
Posting Pro

2 questions: making a program wait, simulating the enter button

 
0
  #1
Jun 4th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 5
Reputation: Abyss is an unknown quantity at this point 
Solved Threads: 0
Abyss Abyss is offline Offline
Newbie Poster

Re: 2 questions: making a program wait, simulating the enter button

 
0
  #2
Jun 7th, 2005
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 // }

}
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 573
Reputation: Dark_Omen is an unknown quantity at this point 
Solved Threads: 5
Dark_Omen Dark_Omen is offline Offline
Posting Pro

Re: 2 questions: making a program wait, simulating the enter button

 
0
  #3
Jun 7th, 2005
Do you need to make a new thread to use a timer, or can you just say
  1. System.Threading.Timer(5000)

Thanks for the help
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 5
Reputation: Abyss is an unknown quantity at this point 
Solved Threads: 0
Abyss Abyss is offline Offline
Newbie Poster

Re: 2 questions: making a program wait, simulating the enter button

 
0
  #4
Jun 7th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 573
Reputation: Dark_Omen is an unknown quantity at this point 
Solved Threads: 5
Dark_Omen Dark_Omen is offline Offline
Posting Pro

Re: 2 questions: making a program wait, simulating the enter button

 
0
  #5
Jun 8th, 2005
OK, thanks for the help.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC