Click here to Skip to main content
15,742,180 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi frnds...
i am new in c# 3.0. i am developing windows based application. my problem is inside timer around 10000 lines of code execute... now i am firing button click event it doesn't fire immediately when i clicked on button.i want to fire click event immediately .. how can i achieve this...

pls help me...
[no name] 8-Jul-11 2:30am    
please provide us the sample code......
Prerak Patel 8-Jul-11 2:34am    
Man, you seriously require some threads.
Sergey Alexandrovich Kryukov 8-Jul-11 3:50am    
Yes, and avoid using timer.
walterhevedeich 8-Jul-11 2:37am    
How do you know it does not fire immediately, have you tried setting a breakpoint on the click event?
Sergey Alexandrovich Kryukov 8-Jul-11 3:48am    
Good point. I'm pretty sure it's not true. Maybe OP tries to simulate key press or doing some other kind of scum.

Share this answer
Sergey Alexandrovich Kryukov 8-Jul-11 3:53am    
Ha-ha, you referenced my solution! Well, there is nothing left for me except voting 5, to avoid discrediting my own work... :-)
Prerak Patel 8-Jul-11 3:58am    
Thanks SA
An events based system will always queue events and deal with them in order. I suspect your definition of 'immediately' is too narrow for an operating system that is not time critical, and never does anything exactly when you ask. Even your timer is not guarenteed to fire EXACTLY when you ask, only that the timer tick joins the message queue at that time.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900