Skip to content

Files

Latest commit

Nov 19, 2020
474d368 · Nov 19, 2020

History

History
56 lines (49 loc) · 1.38 KB

kb-common-change-windows-handedness-settings.md

File metadata and controls

56 lines (49 loc) · 1.38 KB
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

Environment

Product Version 2019.2.618
Product Progress® Telerik® UI for WPF

Description

How to change windows handedness settings in code behind.

Solution

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.

[C#]

{{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}}