WPF Menu displays to the left of the window

后端 未结 2 1257
被撕碎了的回忆
被撕碎了的回忆 2020-12-19 10:31

I have a simple Menu in a DockPanel. Here is the XAML:



        
相关标签:
2条回答
  • 2020-12-19 10:54

    It appears that you have a tablet input device. Follow the instructions in this link to change the handedness in your Tablet PC Settings:

    • menus appear to the left of my cursor
    0 讨论(0)
  • 2020-12-19 10:54

    A fix that worked for me was:

            var ifLeft = SystemParameters.MenuDropAlignment;
            if (ifLeft)
            {
                // change to false
                var t = typeof(SystemParameters);
                var field = t.GetField("_menuDropAlignment", BindingFlags.NonPublic | BindingFlags.Static);
                field.SetValue(null, false);
                ifLeft = SystemParameters.MenuDropAlignment;
            }
    

    Credit: https://www.telerik.com/forums/popup-is-opening-to-outside-window-in-splitbutton

    0 讨论(0)
提交回复
热议问题