Home All Groups Group Topic Archive Search About
Author
22 Dec 2006 12:41 AM
Steve
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

Author
22 Dec 2006 1:06 AM
Scott M.
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.



Show quoteHide quote
"Steve" <s.ar***@comcast.net> wrote in message
news:OF5i8GWJHHA.3872@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
>
>
Author
22 Dec 2006 1:17 AM
Steve
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

Show quoteHide quote
"Scott M." <s-mar@nospam.nospam> wrote in message
news:%23PBz2UWJHHA.2236@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.ar***@comcast.net> wrote in message
> news:OF5i8GWJHHA.3872@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
> >
> >
>
>
Author
22 Dec 2006 1:33 AM
Stephany Young
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.


Show quoteHide quote
"Steve" <s.ar***@comcast.net> wrote in message
news:%23UDP%23aWJHHA.2140@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-mar@nospam.nospam> wrote in message
> news:%23PBz2UWJHHA.2236@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.ar***@comcast.net> wrote in message
>> news:OF5i8GWJHHA.3872@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
>> >
>> >
>>
>>
>
>
Author
22 Dec 2006 2:15 AM
Newbie Coder
Try any of these:

http://www.google.co.uk/search?hl=en&q=%22No+Right+Click%22%2C+%22JavaScript%22&btnG=Google+Search&meta=

I hope this helps,

Newbie Coder

Show quoteHide quote
"Stephany Young" <noone@localhost> wrote in message
news:efU20kWJHHA.420@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.ar***@comcast.net> wrote in message
> news:%23UDP%23aWJHHA.2140@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-mar@nospam.nospam> wrote in message
> > news:%23PBz2UWJHHA.2236@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.ar***@comcast.net> wrote in message
> >> news:OF5i8GWJHHA.3872@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
> >> >
> >> >
> >>
> >>
> >
> >
>
>
Author
22 Dec 2006 2:24 AM
Stephany Young
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.


Show quoteHide quote
"Newbie Coder" <newbie_coder@pleasespamme.com> wrote in message
news:ekP0I7WJHHA.780@TK2MSFTNGP03.phx.gbl...
> Try any of these:
>
> http://www.google.co.uk/search?hl=en&q=%22No+Right+Click%22%2C+%22JavaScript%22&btnG=Google+Search&meta=
>
> I hope this helps,
>
> Newbie Coder
>
> "Stephany Young" <noone@localhost> wrote in message
> news:efU20kWJHHA.420@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.ar***@comcast.net> wrote in message
>> news:%23UDP%23aWJHHA.2140@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-mar@nospam.nospam> wrote in message
>> > news:%23PBz2UWJHHA.2236@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.ar***@comcast.net> wrote in message
>> >> news:OF5i8GWJHHA.3872@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
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>
Author
22 Dec 2006 2:39 AM
Newbie Coder
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
Author
22 Dec 2006 7:02 AM
Steve
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

Show quoteHide quote
"Newbie Coder" <newbie_coder@pleasespamme.com> wrote in message
news:eSuO2IXJHHA.1424@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
>
>