WPF Sub-MenuItem Opening on the Left Instead of the Right

白昼怎懂夜的黑 提交于 2019-11-28 04:23:02

问题


I have set up a simple sample menu.

<Menu>
  <MenuItem Header="Top Menu">
    <MenuItem Header="Item 1">
      <MenuItem Header="Sub Menu 2" />
    </MenuItem>
  </MenuItem>
</Menu>

Sub Menu 2 is opening on the left instead of the expected right side of the menu. I would expect this behaviour if the menu was near the edge of the screen, but window is centered on the screen and not near any edge.

Is there a property that controls where a MenuItem opens on the screen?


回答1:


Does this happen on other applications on your system as well?

There's a registry setting in the value MenuDropAlignment in the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows that controls it system-wide. You might just check to make sure that it is set to 0 instead of 1.

More info can be found in this article.



来源:https://stackoverflow.com/questions/10454482/wpf-sub-menuitem-opening-on-the-left-instead-of-the-right

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!