Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 2.57 KB

popup-content-position.md

File metadata and controls

54 lines (38 loc) · 2.57 KB
title page_title description slug tags published position
Popup Content Position
Popup Content Position
This article describes how to resolve the wrong position of a popup's content when it is not aligned as expected.
troubleshooting-popup-content-position
popup, ribbonview, content, position, troubleshooting
true
1

Popup Content Position

This article describes how to resolve the wrong position of a popup's content when it is not aligned as expected.

The Popup control in WPF is affected by the Windows OS menu settings. This can be noticed in controls that display its content in a popup. For example, the minimized content of RadRibbonView or the items of the RadComboBox control. You can see the popup element aligned to its placement target differently on different machines.

{{ site.framework_name }} Popup Content Position

You can get the same behavior also with a native WPF Border and a Popup attached to it.

{{ site.framework_name }} Popup Content Position Handed Settings

The alignment of the popup is controlled via the Handedness setting of the Windows OS. To resolve the issue you can change the setting via the Windows settings or in code.

Changing the Handedness via the Windows Tablet PC Settings

To change the Handedness via the Windows menu use the following steps:

  1. Open the Windows Start menu and start the Run prompt.

  2. Enter the following command in the Open input - explorer shell:::{80F3F1D5-FECA-45F3-BC32-752C152E456E}. This will open the Tablet PC Settings

    {{ site.framework_name }} Popup Content Position Run Shell Command

  3. Click in the Other tab of the settings window and select the Left-handed option. Then click okay.

    {{ site.framework_name }} Popup Content Position Set handedness

Changing the Handedness in code

To change the handedness in code you can use the SystemParameters static class and its _menuDropAlignment field. Keep in mind that the filed is private so you can set it only via reflection.

_[C#] Example 1: Setting the menuDropAlignment field

{{region troubleshooting-popup-content-position-0}} 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}}