Jul 15 2011

Where is your Right Click Context Menu?

Category: .Net Development | SoftwareJRBlack @ 16:57

Recently working on the UI of a WPF project I struggled attempting to get the Right Click Context Menu to appear as normal, to the right and below the mouse pointer.  No matter what options I used with ContextMenu (.Placement and .PlacementRectangle) the Context Menu would appear to the left and down instead of the right and down.

I spent a few hours researching, testing, debugging, no matter what I couldn’t get the context menu to appear to the right.  I then enlisted the help of some other developers at the .Net Framework Developer Center forums and learned I was making the correct assumptions and doing the right things but it was still not working.  Link to forum thread.

I then noticed that the positioning of the Context Menu was not consistent with all applications on my system.  I am using a Fujitsu Lifebook Tablet PC, running Windows 7.  Most of the apps I use daily, Visual Studio 2010, Chrome, FireFox, AIM to name a few all had context menu normally to the right and down from the mouse pointer.  But Explorer, Microsoft Office, Internet Explorer for example all had the context menu to the left and down.

clip_image002Further research on Google finally revealed that Windows 7 had a registry key that would determine if the context menu appeared to the right or left.  And more importantly Windows 7 had control panel settings specific to a Tablet PC.

clip_image002[7]The default “Right-handed” user on a tablet would set the context menu to the left for easier access while using the actual tablet surface instead of using a mouse like a normal laptop.  This, I assume, would make it easier to select items from the context menu for a right handed user.  Unfortunately it was an unknown distraction that took several hours to track down.

Clearly Chrome, FireFox and Visual Studio 2010 have found a way around this Registry key, or they work around it some how, but I have yet to find a way with WPF.

Tags:

Comments

9/5/2011 11:45:50 PM

Andrew Cole

Tremendously insightful thank you, I believe your visitors would certainly want further articles such as this maintain the good hard work.

9/7/2011 12:52:52 AM

Tim Anderson

Highly good bless you, I think your trusty visitors would likely want further items like that keep up the good hard work.

9/13/2011 1:00:06 PM

range extender

In the event you could e-mail me with a few suggestions on just how you made your blog look this excellent, I'd be grateful.

10/14/2011 1:51:18 PM

sanamirza

Grate work,
Thanks for this nice sharing .

10/14/2011 3:39:08 PM

 sariasam

Interesting info.very informative post.
Weldon job.

12/12/2011 7:33:30 PM

Licensed Plumber in Malton

Hi everybody else !!! The blog was totally fantastic!
you all do such a fantastic job at such Concepts..., for one appreciate all you do!

Comments are closed