Solved

Check for event in event queue

Posted on 2006-11-16
2
254 Views
Last Modified: 2010-04-16
When a context menu item is clicked, the click event isn't handled immediately. Instead, the context menu is dismissed, subsequent statements (statements following the calling of the Show method of the menu) are executed, and only then the menuitem's click event is handled.

I need that, immedately after calling Show, before any other statement is executed, to determine if a certain menuitem was clicked.

I thought of checking whether the click event of the menuitem is in the event queue, but how to do that? Or maybe there is another solution?
0
Comment
Question by:campinas
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
Comment Utility
contextMenu1.Show(...);
Application.DoEvents();    // here context menu item handler is called
// ... other code

In item handler you can set some variable which can show you that item was selected.

0
 

Author Comment

by:campinas
Comment Utility
Thank you, appreciate your help!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now