|
-
Jul 5th, 2004, 02:02 PM
#1
Thread Starter
New Member
How to determine if a context menu is currently displayed (OR NOT)
This may seem wierd but I need to determine if a contextmenu is currently shown (or more precisely when it is not).
Background: I have a user control that creates a contextmenu. When I click on the user control I raise an event that the host app receives and in turn, calls the user control show method that shows the context menu. Within the user control, I need to determine if the menu is still "visible". If the user has clicked somewhere else on the host application form, the context menu goes away but I need the user control to determine that the context menu has indeed gone away. Checking the contextmenu.menuitems(0).visible property does not do the trick.
Any Suggestions?
-
Jul 6th, 2004, 02:58 AM
#2
What about setting a flag when your code shows the menu and then in each of the menu items, cancelling the flag again and calling Application.DoEvents() to get rid of the menu, then the code for that menu item can run.
I don't live here any more.
-
Jul 6th, 2004, 12:08 PM
#3
Thread Starter
New Member
Thanks for your reply... not sure what you're saying... The host app basically receives two events... one that the user clicked on the user control and it in turn calls the user control showmenu method, the other that a menu item has been clicked on. What is at issue is when the menu goes away because the user clicks on any other host app control or the host app form itself... I have introduced a boolean switch for the two events the control fires, one to show the menu (bMenuShown = True) and when the user clicks on a menu item (bMenuShown = False). But if the menu goes away for any other reason than a menuitem click then the bMenuShown will reflect the wrong value (still set to True)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|