Skip to main content

Microsoft Silverlight

Answered Question Can I handle the Mouse Right Click in Silverlight 2 ?RSS Feed

(0)

JOUNEY
JOUNEY

Member

Member

0 points

3 Posts

Can I handle the Mouse Right Click in Silverlight 2 ?

There are the next mouse event: MouseMove, MouseLeftButtonUp, MouseLeftButtonDown, MouseLeave, MouseEnter. But what about Mouse Right Click? I want to handle mouse right click. Can I do?

metal
metal

Participant

Participant

1243 points

262 Posts

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

 The Deep Zoom auto created projects have a Javascript handler to pass through mouse wheel scrolling events, you ould look at that, but I am guessing the current Right click action of  "Silverlight Configuration" can not be over ridden.

pbromberg
pbromberg

Contributor

Contributor

2128 points

370 Posts

Answered Question

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

A quick search on Silverlight "right click" reveals this:

http://silverlight.net/blogs/msnow/archive/2008/07/01/tip-of-the-day-14-how-to-right-click-on-a-silverlight-application.aspx

o_programador
o_progra...

Member

Member

14 points

2 Posts

Answered Question

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

Yes. And here goes a very simple project demonstrating how to do that at the KYNOU.com web site

 

http://www.kynou.com/Samples/TestingSilverlightRightClick.zip

 

 

JOUNEY
JOUNEY

Member

Member

0 points

3 Posts

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

Thank you guys~

But Can I use "Silverlight Configuration"?

If I use ContextEvent, How can users auto update Silverlight plug in?

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24979 points

2,434 Posts

Microsoft
Answered Question

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

Hi Jouney,

As far as I know,   we can use JavaScript to get the ContextMenu and  add "Silverlight Configuration" as an item to the ContextMenu.  But we cannot call the Silverlight Configuration Dialogue.

Best regards,

Jonathan

 

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

o_programador
o_progra...

Member

Member

14 points

2 Posts

Re: Can I handle the Mouse Right Click in Silverlight 2 ?

The code that I submitted assumes that you don't want to get the configuration UI (it's the most common case). But if you do want to do your context menu and still let the silverlight configuration window appear just don't use the e.PreventDefault() method you will find in the posted code.

 

I hope this helps

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities