469,592 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

mouse right click

How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code as my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve
Dec 22 '06 #1
7 3278
This is not done with server-side code since the mouse clicks originate at
the client.

Use JavaScript and the onMouseDown client-side event handler to accomplish
this.

"Steve" <s.*****@comcast.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code as my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve


Dec 22 '06 #2
Hi Scott...

This is for a client application and I'm only coding in vb 2005. Isn't
there a way to intercept the right mouse down event and cancel it?

Steve

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
This is not done with server-side code since the mouse clicks originate at
the client.

Use JavaScript and the onMouseDown client-side event handler to accomplish
this.

"Steve" <s.*****@comcast.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code as my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve


Dec 22 '06 #3
The MouseUp event is the one you want.

The information about which mouse button was used and the ability to cancel
it is available in the event arguments.
"Steve" <s.*****@comcast.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
Hi Scott...

This is for a client application and I'm only coding in vb 2005. Isn't
there a way to intercept the right mouse down event and cancel it?

Steve

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>This is not done with server-side code since the mouse clicks originate
at
the client.

Use JavaScript and the onMouseDown client-side event handler to
accomplish
this.

"Steve" <s.*****@comcast.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code as
my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve




Dec 22 '06 #4
Try any of these:

http://www.google.co.uk/search?hl=en...e+Search&meta=

I hope this helps,

Newbie Coder

"Stephany Young" <noone@localhostwrote in message
news:ef*************@TK2MSFTNGP06.phx.gbl...
The MouseUp event is the one you want.

The information about which mouse button was used and the ability to
cancel
it is available in the event arguments.
"Steve" <s.*****@comcast.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
Hi Scott...

This is for a client application and I'm only coding in vb 2005. Isn't
there a way to intercept the right mouse down event and cancel it?

Steve

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
This is not done with server-side code since the mouse clicks originate
at
the client.

Use JavaScript and the onMouseDown client-side event handler to
accomplish
this.

"Steve" <s.*****@comcast.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code as
my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve





Dec 22 '06 #5
Why would a link to a search on JavaScript help?

The OP has made it clear that he is working on a Windows Forms application
using VB.NET.

I hope you realise that you have just perpetuated the 'heinous sin' that, a
couple of days ago, you roundly criticised others for doing.
"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:ek*************@TK2MSFTNGP03.phx.gbl...
Try any of these:

http://www.google.co.uk/search?hl=en...e+Search&meta=

I hope this helps,

Newbie Coder

"Stephany Young" <noone@localhostwrote in message
news:ef*************@TK2MSFTNGP06.phx.gbl...
>The MouseUp event is the one you want.

The information about which mouse button was used and the ability to
cancel
>it is available in the event arguments.
"Steve" <s.*****@comcast.netwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl. ..
Hi Scott...

This is for a client application and I'm only coding in vb 2005. Isn't
there a way to intercept the right mouse down event and cancel it?

Steve

"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
This is not done with server-side code since the mouse clicks
originate
at
the client.

Use JavaScript and the onMouseDown client-side event handler to
accomplish
this.

"Steve" <s.*****@comcast.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
How do you disable the mouse right click to prevent pop-up window?

Or if I want to have cut/copy/paste on pop-up window use same code
as
my
custom cut/copy/paste that are triggered by toolstrip buttons?

Thanks

Steve




Dec 22 '06 #6
One of the lasts posts mentioned using Javascript, Stephany. Besides, I
cannot see you being much good. See Scott's post below & my advice under:

=================================
Scott's Post:

This is not done with server-side code since the mouse clicks originate at
the client.

Use JavaScript and the onMouseDown client-side event handler to accomplish
this.

==================================

You can just say

if e.button = 2 then
messabgox.show("Disabled")
end if

You can also subclass a standard textbox to remove the context menu items
you wish, but it you use CTRL + C... then its not always good

But I had the same thing many years ago in a windows app & it was handled in
WndProc with the subclassing as mentioned above

There is always that you create a blank context menu & add that to the
textbox

textbox1.contextmenu = contextmenu1...

That way when you right-click you get nothing

I have deleted the subclassing removing the paste/copy items now so I cannot
pass it on - sorry

I hope this has given you some ideas,

Newbie Coder
Dec 22 '06 #7
Actually what I ended up doing was substituting my own menu of options using
contextmenustrip. And then I can have the cut, copy, and paste operations
do what I need it to do.

Thanks

Steve

"Newbie Coder" <ne**********@pleasespamme.comwrote in message
news:eS**************@TK2MSFTNGP04.phx.gbl...
One of the lasts posts mentioned using Javascript, Stephany. Besides, I
cannot see you being much good. See Scott's post below & my advice under:

=================================
Scott's Post:

This is not done with server-side code since the mouse clicks originate at
the client.

Use JavaScript and the onMouseDown client-side event handler to accomplish
this.

==================================

You can just say

if e.button = 2 then
messabgox.show("Disabled")
end if

You can also subclass a standard textbox to remove the context menu items
you wish, but it you use CTRL + C... then its not always good

But I had the same thing many years ago in a windows app & it was handled
in
WndProc with the subclassing as mentioned above

There is always that you create a blank context menu & add that to the
textbox

textbox1.contextmenu = contextmenu1...

That way when you right-click you get nothing

I have deleted the subclassing removing the paste/copy items now so I
cannot
pass it on - sorry

I hope this has given you some ideas,

Newbie Coder


Dec 22 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Champaign | last post: by
3 posts views Thread by mitsura | last post: by
25 posts views Thread by Romanise | last post: by
3 posts views Thread by Morten Snedker | last post: by
5 posts views Thread by Adeel | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.