Page view counter
Right-click handling with windowless=false Subscribe to this thread
Last post 01-13-2009 4:26 AM by lingbing. 3 replies.
Sort Posts:
12-26-2008 3:56 AM
Right-click handling with windowless=false
Is it even theoretically feasible to enable mouse right-click handling with windowless=false ? Every sample I've seen so far requires windowless mode, but then there are multiple limitations that get introduced. Flash seems to have easier model for introducing custom context menus for example tha work in all browsers/platforms. Any ideas on better solutions in Silverlight?

 

Tolik2

Loading...
Joined on 07-04-2008
Posts 36
12-26-2008 8:54 PM
Re: Right-click handling with windowless=false

Remember browser doesn't know what is java and C#, it can only know what is javascript. So the event provide by browser is a javascript event. Whether an application running on browser supports mouse right click event or not is only according to if it present the event to developers.

When we want to handle right-click event, we must use System.Window.Browser.HtmlPage.Document.AttachEvent to attach the eventhandler for the javascript event oncontextmenu. And the limit that we have to set the windowless as false seems there is no way to avoid it.

Some people tell me that in MacOS, there is not the meaning of mouse right-click, I never use that. But both flash and silverlight don't support right-click defaultly, maybe this is the reason.

Regards!

Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China

lingbing

Loading...
Joined on 07-16-2008
Beijing
Posts 345
01-13-2009 3:27 AM
Re: Right-click handling with windowless=false

I beg to disagree with you on last point Ling. Flash does use right-click pretty well - it allows you to add custom menu items to its context menu and yes that value is available on Mac - it's just Ctrl-click not right-click, which is also unavailable in Silverlight.

Tolik2

Loading...
Joined on 07-04-2008
Posts 36
01-13-2009 4:26 AM
Re: Right-click handling with windowless=false

Thanks, I've never used MacOS, you tell me the fact.

The flashes (swf file) I have seen in some pages, when I right-click on them, the show Adobe-Flash-Configurations, which is just like Silverlight-Configuration. I have seen some applications have right-click support, but I didn't read their code.

Regards!

Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China

lingbing

Loading...
Joined on 07-16-2008
Beijing
Posts 345
Microsoft Communities