Skip to main content

Microsoft Silverlight

Unanswered Question Right-click handling with windowless=falseRSS Feed

(0)

Tolik2
Tolik2

Member

Member

6 points

36 Posts

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?

 

lingbing
lingbing

Contributor

Contributor

2249 points

406 Posts

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

Tolik2
Tolik2

Member

Member

6 points

36 Posts

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.

lingbing
lingbing

Contributor

Contributor

2249 points

406 Posts

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
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities