943,947 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 12229
  • C# RSS
Jun 4th, 2005
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 23
Solved Threads: 6
Posting Pro
Dark_Omen is offline Offline
573 posts
since Apr 2004
Jun 7th, 2005
0

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

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 // }

}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Abyss is offline Offline
5 posts
since Jun 2005
Jun 7th, 2005
0

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

Do you need to make a new thread to use a timer, or can you just say
C# Syntax (Toggle Plain Text)
  1. System.Threading.Timer(5000)

Thanks for the help
Reputation Points: 23
Solved Threads: 6
Posting Pro
Dark_Omen is offline Offline
573 posts
since Apr 2004
Jun 7th, 2005
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Abyss is offline Offline
5 posts
since Jun 2005
Jun 8th, 2005
0

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

OK, thanks for the help.
Reputation Points: 23
Solved Threads: 6
Posting Pro
Dark_Omen is offline Offline
573 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: opening IE using c#?
Next Thread in C# Forum Timeline: question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC