Sign in to follow this  

[.net] Handling multiple events simultaneously?

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is my problem: I am working on a program that has the bulk of the program within an event, specifically a button_click event. There is an infinite loop within this event. If I create another button and click it after the aforementioned button, will the system handle the second button_click event simultaneously? If not, I guess I'll have to revise my approach. Thanks in advance for any and all replies!

Share this post


Link to post
Share on other sites
I believe it depends on how your application is coded. If within the first event handler you are executing the infinite loop on the same thread (e.g. you are not creating a new thread and execute the infinite loop on the newly created thread), then your UI will essentially be "hung" and won't be able to fire the second button's click event. However, if your application is already multithreaded, it should be fine.

Keep in mind that you should *never* (ideally) have any code that "freezes" your UI. If there is any code that is resource intensive, fire it up in a different thread so that your UI is still responsive.

Share this post


Link to post
Share on other sites

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this