title | page_title | description | type | slug | position | tags | ticketid | res_type |
---|---|---|---|---|---|---|---|---|
Change Windows Handedness Settings in Code Behind |
How to change Windows Tablet PC Handedness Settings |
Change where the Popup menus appear on the screen by setting SystemParameters.MenuDropAlignment. |
how-to |
kb-common-change-windows-handedness-settings |
0 |
windows,tablet,settings,left-handed,right-handed,handedness,pc |
1429407 |
kb |
Product Version | 2019.2.618 |
Product | Progress® Telerik® UI for WPF |
How to change windows handedness settings in code behind.
To change the Windows Handedness settings in code, you can set the SystemParameters.MenuDropAlignment property. The method need to be called after the InitializeComponent() method.
{{region kb-common-change-windows-handedness-settings-0}} public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); SetAlignment(); } }
public static void SetAlignment()
{
var ifLeft = SystemParameters.MenuDropAlignment;
if (ifLeft)
{
var t = typeof(SystemParameters);
var field = t.GetField("_menuDropAlignment", BindingFlags.NonPublic | BindingFlags.Static);
field.SetValue(null, false);
}
}
{{endregion}}