czfdragon
asked on
How to disable the default mouse right click menu on a text box ?
hello!
How to disable the default right click menu of the mouse on a text box in vb.net?
i really need your help.
thank you!
How to disable the default right click menu of the mouse on a text box in vb.net?
i really need your help.
thank you!
I know 2005 has the options to add and build a context menu strip (right click menu) from the toolbox. But if you need to do it via code
http://msdn2.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
http://msdn2.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx
ASKER
first thank you .
i am sorry.
i may have misunderstood you.
my means is that when i put the mouse on the textbox and right click the mouse ,the menu(copy,delet,paste such as ) is disabled.
It is said that copy,delete such as will not be used.
can you understand me?
i am sorry.
i may have misunderstood you.
my means is that when i put the mouse on the textbox and right click the mouse ,the menu(copy,delet,paste such as ) is disabled.
It is said that copy,delete such as will not be used.
can you understand me?
If you do not want to allow the user to perform delete, paste and cut you can set the ReadOnly property of the textbox to True. As for copy, you might want to check the keypress event for that.
ASKER
i am sorry again.
The textbox is editable,so i cann't set the readonly property of the textbox.
i need your help!
The textbox is editable,so i cann't set the readonly property of the textbox.
i need your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
as far as my first comment regarding the context menu strips... if you add one to the form and assign it to the textbox without designing or adding any menu items it will in effect do what you are looking for.
if the user right clicks on the textbox absolutely nothing will happen. No menu will be shown.
I am sure there is a cleaner option to do the same thing and I will look into it but this will work.
if the user right clicks on the textbox absolutely nothing will happen. No menu will be shown.
I am sure there is a cleaner option to do the same thing and I will look into it but this will work.
ASKER
thanks for everyone!
And sepecial thanks for TheLearnedOne .Your help is my inneed.
And sepecial thanks for TheLearnedOne .Your help is my inneed.
with the contextmenustrip you can build your own right click menu for any control on a form.
hth
K