0

I have a few question. Is it possible to disable this menu when i press rightclick?

enter image description here

I have my own context menu strip and my problem is when i press right click that default menu is shown. then i will press left click to remove that default menu then my own menu strip will now be visible.

Is there any way to disable that default menu and directly show my menu strip when i right click?

Note: Default Menu will be shown if editing is on going.

Muj
  • 146
  • 2
  • 21

2 Answers2

2

You can set Shortcuts enabled = false in the properties of the textbox

Benno
  • 2,534
  • 1
  • 17
  • 27
  • I think my question is a duplicate. I already found my answer for textbox. http://stackoverflow.com/questions/4083475/how-to-remove-the-default-context-menu-of-a-textbox-control-c-sharp – Muj Oct 13 '16 at 08:36
  • for datagridview http://stackoverflow.com/questions/16309613/removing-the-default-context-menu-when-editing-a-cell-in-datagridview – Muj Oct 13 '16 at 08:36
2

Add this to the Form_Load where the TextBox is placed:

txtBox1.ContextMenuStrip = New ContextMenuStrip

Declaring a new ContextMenuStrip is like replacing the old one with a new "blank" one.

Aethan
  • 1,986
  • 2
  • 18
  • 25
  • I think my question is a duplicate. I already found my answer for textbox. http://stackoverflow.com/questions/4083475/how-to-remove-the-default-context-menu-of-a-textbox-control-c-sharp – Muj Oct 13 '16 at 08:38
  • for datagridview http://stackoverflow.com/questions/16309613/removing-the-default-context-menu-when-editing-a-cell-in-datagridview – Muj Oct 13 '16 at 08:38