Thursday, November 20, 2008
Trusted by over 7 million customers!
RTLRightClickFix V2 for Silverlight 2 - Right Click Context Menu for SL2
Minimize
Location: BlogsSilverlight Code & Controls   
Posted by: Ken Dopierala Jr.3/13/2008 12:27 PM
Implement your own HTML or XAML context menu on a right mouse click. Updated for Silverlight 2, includes support for IE and Firefox.

The right click code has been updated to be compatible with Silverlight 2.  Along with SL2 support IE and Firefox support is included.

You can implement the right click on your whole canvas or only selected portions.

I'm looking into adding this support to the library of controls released by Microsoft.

You can view a demo and download the source here: http://www.realtimesilverlight.com/RTLRightClickFix/RTLRightClickFix.aspx

Feel free to email me with any feedback: Ken@RTLogicSystems.Com

Copyright ©2008 Ken Dopierala Jr.
Permalink | Trackback

Comments (5)  Add Comment
Re: RTLRightClickFix V2 for Silverlight 2 - Right Click Context Menu for SL2  By PhanDinh HaiSon on 3/20/2008 8:04 PM
Dear!<br>Could I use your code on my business software?

Re: RTLRightClickFix V2 for Silverlight 2 - Right Click Context Menu for SL2  By RadiateLogic on 3/20/2008 8:33 PM
Feel free. All code is available as is to use for anything you want. If it makes your app better awesome! If there is a bug don't sue me. ;-}

Re: RTLRightClickFix V2 for Silverlight 2 - Right Click Context Menu for SL2  By Phan-Dinh Hai-Son on 3/23/2008 7:58 PM
Dear!<br>In firefox, we can use this way to handle the right click event but we can't handle the mouse left button event. :(

Re: RTLRightClickFix V2 for Silverlight 2 - Right Click Context Menu for SL2  By Steve Commisso on 7/9/2008 11:50 AM
Right, if you want to do that you'll have to follow the same model he used to get the right-click working. Since the right-click requires the DIV overlay (in FireFox at least), Silverlight cannot receive the mouse events. You'll notice that left-click works when you bring the context-menu up because the DIV is hidden when a right-click occurs. You need to funnel the onmousedown, onmouseup, onmousemove through JavaScript to Silverlight and perform hit tests just as with the right-click to get this to work. Surprisingly the performance is still great! Here's an example. It has right click, left click, left double-click, and mouse over events.<br><br>http://www.zleek.com/ZleekPage.aspx?PID=1<br><br>Ken, I used your code as a starting point for this, thanks!

Right-click on Silverlight 2.0 from KYNOU.com  By Eric Viegas on 11/12/2008 8:36 PM
Sorry! But I could not make this work on Silverlight 2.0.<br><br>But I found another simple and quick sample project that demonstrates how to intercept right-click on silverlight. Check it out!<br><br>http://www.kynou.com/Samples/TestingSilverlightRightClick.zip


Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
Nationwide Freight Trucks - Reefer - Expedited - LTL - Truck Load - Brokerage

Free Online Dating Coupons (Match.Com, Date, PerfectMatch, Lavalife and More)



Blog_Archive
Minimize

Print  

Nationwide Building Permits - Courier Services - Expedited Permits - Retail Construction Permits

Who is looking for you online?
Find out now....


Click Here to get 1 month FREE Dedicated Hosting
Trusted by over 7 million customers!

Privacy Statement  |  Terms Of Use
Copyright 2007 by RTLogicSystems.Com