Solved

Check for event in event queue

Posted on 2006-11-16
2
256 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
ID: 17963283
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
ID: 17963368
Thank you, appreciate your help!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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