Disable context menu or close context menu 
Author Message
 Disable context menu or close context menu

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



Tue, 07 Sep 2004 20:03:08 GMT  
 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
|
|
|



Wed, 08 Sep 2004 01:16:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Context Menu Handlers disables standard menu items

2. disable menu point in TextBox context menu

3. show a shortcut menu / popup menu / context menu

4. Disable context menu on text field

5. disable context menu on TextBox ?

6. disable context menu on web control

7. Disabling context menu in Text Box Help!!!

8. Combo Box System Context menu disabling Help!!!

9. Disable context menus on Desktop and Common Dialog Box

10. Win95 edit context menu disable API

11. Disabling default textbox context menus

12. Disable Explorer Context Menu

 

 
Powered by phpBB® Forum Software