Disable default context menu

DiverDan

Contributor
Joined
Jan 16, 2003
Messages
645
Location
Sacramento, CA
I've just finished some very nice looking owner drawn menus and context menus. The context menus are displayed only in designated TextBoxes (user input boxes) that I specified at design time. When I ran the program all worked very well except that...the VB default context menu still worked in the non designated TextBoxes. How can I stop the default context menu in these boxes and still maintain my owner drawn context menus?

Thanks
 
Hi Robby,

Yes, it does very well. However, it is the other (non-designated)textboxes that I would like to prevent the default context menu from displaying. In other words prevent any and all context menus from poping up over specific textboxes.
 
You can override the default contextmenu by setting the ContextMenu property to a new, blank instance of the ContextMenu class:

Visual Basic:
TextBox1.ContextMenu = New ContextMenu()
 
Back
Top