Menu placement - Menu opening outside of window


  • I'm trying to add a simple menu in WPF (using C#).  The lack of easy drag-and-drop configuration is a little disappointing but I was able to add the items I wanted:


    <Window x:Class="TestProgram.MainWindow"
            Title="MainWindow" Height="350" Width="525">
            <DockPanel VerticalAlignment="Top">
                <Menu DockPanel.Dock="Top" >
                    <MenuItem Header="_File">
                        <MenuItem Header="_New" />
                        <Separator />
                        <MenuItem Header="_Open" />
                        <Separator />
                        <MenuItem Header="_Save" />
                        <MenuItem Header="Save As…" />
                        <MenuItem Header="Exit" Click="mnuFileExit_Click" />
                    <MenuItem Header="_Edit">
                        <MenuItem Header="Cut" />
                        <MenuItem Header="Copy" />
                        <MenuItem Header="Paste" />
                    <MenuItem Header="_Help">
                        <MenuItem Header="About" />

    However, when I launch the application it opens the menu to the left, going outside the window: 

    1. How can I keep the menu inside?  Why is it doing that? 

    2. I'd also like it to show hot-keys text in the menu, such as "Ctrl-O" next to "Open". know I can manually add them but is there not an automatic way?

    • Edited by DG Osborne Friday, September 12, 2014 3:31 AM
    Friday, September 12, 2014 3:31 AM


  • Thanks, I am aware it has nothing to do with Visual Studio.  That was my response to unhelpful information that was equally irrelevant.

    Thanks! The problem was solved via that first link:

    • Press Windows Key + R
    • Enter shell:::{80F3F1D5-FECA-45F3-BC32-752C152E456E}
    • Select the "Other" tab
    • In "Handedness", select "Left Handed"

    While I understand the idea behind this, you have to admit it's pretty silly for me to need to choose "Left Handed" from some obscure setting to get the menus to behave normally.  I'm not on a tablet, nor am I using a touch-screen.

    Even if I *were* using a touch-screen, I doubt very much that I would want the so-called "Right Handed" behavior.  I would want the "Left Handed" behavior regardless of which hand I used.

    • Marked as answer by DG Osborne Wednesday, September 24, 2014 12:01 AM
    • Edited by DG Osborne Wednesday, September 24, 2014 12:03 AM
    Tuesday, September 23, 2014 11:58 PM

All replies