473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

ToolStripTextBox right click

hi there,
does anyone know how to prevent the context menu on a ToolStripText box from
appearing?

when i right click on the toolstriptextbox i get presented with the system
undo
------
cut
copy
paste
-----
delete

context menu, i need to disable this menu showing.
any ideas?
Nov 17 '05 #1
4 6039
Brian,

In order to do this, you would have to disable the right click
functionality of the toolbox, I believe. You can derive from TextBox, and
then override the WndProc method to intercept the WM_RBUTTONDOWN
notification.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
hi there,
does anyone know how to prevent the context menu on a ToolStripText box
from
appearing?

when i right click on the toolstriptextbox i get presented with the system
undo
------
cut
copy
paste
-----
delete

context menu, i need to disable this menu showing.
any ideas?

Nov 17 '05 #2
Hi Nicholas,

I tried to take this approack by not handling the WM_CONTEXTMENU = 0x007b;
in the WndProc but...
ToolStripTextBox doesn not derive from control. so there is no wndproc,
So i tried to do it with the ToolStrip itself but to no affect.
I'll figure it out somehow when i get back to it and i'll post the solution.
thanks
Brian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

In order to do this, you would have to disable the right click
functionality of the toolbox, I believe. You can derive from TextBox, and
then override the WndProc method to intercept the WM_RBUTTONDOWN
notification.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
hi there,
does anyone know how to prevent the context menu on a ToolStripText box
from
appearing?

when i right click on the toolstriptextbox i get presented with the system
undo
------
cut
copy
paste
-----
delete

context menu, i need to disable this menu showing.
any ideas?


Nov 17 '05 #3
Brian,

I just noticed that. In order to get around this, you can get the
hosted TextBox by calling the TextBox property. Then, you should be able to
create a class derived from NativeWindow which overrides the WndProc method
to ignore the context menu message.

When you get the textbox property, get the handle, and assign the handle
to your overridden NativeWindow class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
Hi Nicholas,

I tried to take this approack by not handling the WM_CONTEXTMENU = 0x007b;
in the WndProc but...
ToolStripTextBox doesn not derive from control. so there is no wndproc,
So i tried to do it with the ToolStrip itself but to no affect.
I'll figure it out somehow when i get back to it and i'll post the
solution.
thanks
Brian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

In order to do this, you would have to disable the right click
functionality of the toolbox, I believe. You can derive from TextBox,
and
then override the WndProc method to intercept the WM_RBUTTONDOWN
notification.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
> hi there,
> does anyone know how to prevent the context menu on a ToolStripText box
> from
> appearing?
>
> when i right click on the toolstriptextbox i get presented with the
> system
> undo
> ------
> cut
> copy
> paste
> -----
> delete
>
> context menu, i need to disable this menu showing.
> any ideas?


Nov 17 '05 #4
Hi Nicholas, excellen, u def deserve the MVP!
I didn't know about the TextBox property, thanks alot, i'm home free now.

regds
Brian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

I just noticed that. In order to get around this, you can get the
hosted TextBox by calling the TextBox property. Then, you should be able to
create a class derived from NativeWindow which overrides the WndProc method
to ignore the context menu message.

When you get the textbox property, get the handle, and assign the handle
to your overridden NativeWindow class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
Hi Nicholas,

I tried to take this approack by not handling the WM_CONTEXTMENU = 0x007b;
in the WndProc but...
ToolStripTextBox doesn not derive from control. so there is no wndproc,
So i tried to do it with the ToolStrip itself but to no affect.
I'll figure it out somehow when i get back to it and i'll post the
solution.
thanks
Brian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

In order to do this, you would have to disable the right click
functionality of the toolbox, I believe. You can derive from TextBox,
and
then override the WndProc method to intercept the WM_RBUTTONDOWN
notification.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Keating" <Br**********@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
> hi there,
> does anyone know how to prevent the context menu on a ToolStripText box
> from
> appearing?
>
> when i right click on the toolstriptextbox i get presented with the
> system
> undo
> ------
> cut
> copy
> paste
> -----
> delete
>
> context menu, i need to disable this menu showing.
> any ideas?


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: George Hester | last post by:
In a page I have when the user left-clicks the page a Input box for a form gets the focus. But if the user right-clicks the page the Input box is not getting the focus. I'd like the Input box to...
2
by: Sean | last post by:
Hi, I have a treeview and user can right click the treenodes, depending on the nodes, different shortcut menu will appear. I want only the shortcut menu to appear if the point of the right...
11
by: Terry Olsen | last post by:
How can I catch a right-click on a DropDownMenuItem?
3
by: osmarjunior | last post by:
I cannot set focus on a ToolStripTextBox of my tool bar. I've tried the following: myToolBar.Select(); myTextBox.Focus(); The edit cursor doesn't appear on the text box... strange!!!... ...
2
by: matthewr | last post by:
In Internet Explorer, for example, when you hit return in the address bar, the Go button is pressed. In my program, I have a toolstrip with a textbox and button. How do I ensure the button is...
0
by: Gianmaria Iaculo - NVENTA | last post by:
Hi, i need a custom toolstriptextbox... something that is similar to the standard one but witha button on the right. I want to bypass the user "ENTER" and let him press a button with something...
0
by: mcurros | last post by:
Too late but it may be of some help to others... me.ActiveControl=me.ToolStripTextBox.Control Cheers! Mariano
4
by: Lloyd Sheen | last post by:
I just want to select the complete text when someone enters the textbox (mouse click etc.). When I am executing within the IDE (VS 2005 Pro) no problem. Execute outside the IDE and no select...
2
by: Lloyd Sheen | last post by:
I am just trying to get the event when a user clicks into the ToolStripTextBox to allow me to select all the text. I got an answer to handle the click event as an enter. Well if I do that then I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.