
Disable context menu or close context menu
You can just set the ContextMenu property of the control to Nothing. Are
you saying you don't want to set the ContextMenu at runtime? Any reason
why? What about disabling all the menu items? You can use
ContextMenu.MenuItems collection to do this.
For Each mnuItem In ContextMenu1.MenuItems
mnuItem.Enabled = False
Next
Brian Roder [MS]
This posting is provided 'AS IS' with no warranties, and confers no rights.
<http://www.microsoft.com/info/terms.htm>
Please do not send email directly to this alias. This is our online account
name for newsgroup participation only.
--------------------
| Subject: Disable context menu or close context menu
| Date: Fri, 22 Mar 2002 13:03:08 +0100
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: c247-250.users.skanska.se 144.57.247.250
| Path: cpmsftngxa07!tkmsftngp01!tkmsftngp05
| Xref: cpmsftngxa07 microsoft.public.dotnet.languages.vb:36657
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hello!
|
| Does anyone now how to disable a context menu? I have different controls
| with different context, som I don't want to change the contextmenu
property
| at these controls.
|
| Another way is that for example when contextmenu_popup event executes a
| check if bShowNoMenus = true the contextmenu should be closed, but I can't
| find a method for closing a context menu.
|
| Help
| /Magnus
|
|
|