|
-
Jan 23rd, 2004, 09:48 AM
#1
Thread Starter
Hyperactive Member
Cancel ContextMenu popup...
Hey,
Anyone know a way to cancel a Context Menu popup in the popup event?
Thanks,
Ben
-
Jan 23rd, 2004, 10:21 AM
#2
Member
Not sure exactly what you mean, or why you'd want to do this at that point, but...
VB Code:
Dim m As MenuItem
For Each m In ContextMenu.MenuItems
m.Visible = False
Next
...will prevent any context menu from being displayed at the point of the popup event.
-
Jan 23rd, 2004, 12:41 PM
#3
Thread Starter
Hyperactive Member
I want to (sometimes) suppress the context menu when the user right-clicks my control.. but only sometimes. Specifically when they click inside my listview control, but not on an actual list item.
--Ben
-
Jan 23rd, 2004, 02:33 PM
#4
Im not at a .net machine atm. but check the passed arguments in the popup event. Should be e. something if you can do it. Else it could be that you have to add an event handler for click and then showing it yourself.
-
Jan 23rd, 2004, 05:25 PM
#5
Member
Originally posted by BenFinkel
Specifically when they click inside my listview control, but not on an actual list item.
In that case, modify the above code to...
VB Code:
Dim m As MenuItem
For Each m In ContextMenu1.MenuItems
m.Visible = CBool(ListView1.SelectedItems.Count)
Next
This will then only display the popup menu when actually clicking on an item - anywhere else nothing will popup.
That what your after?
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
|