WPF Sub-MenuItem Opening Left, Not Right

I created a simple examples menu.

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

Submenu 2 opens on the left instead of the expected right side of the menu. I would expect this behavior if the menu was close to the edge of the screen, but the window is centered on the screen and not close to any edge.

Is there a property controlling where MenuItem appears on the screen?

+6
source share
1 answer

Does this happen in other applications of your system?

There is a registry setting in the MenuDropAlignment value in the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows , which controls it throughout the system. You can simply check that it is set to 0 instead of 1.

This article can be found .

+12
source

Source: https://habr.com/ru/post/914927/


All Articles