The WPF dialog box disappears when it displays a tooltip or drop-down combo box in Windows 8 or Windows Server 2012


When a tooltip or a drop-down combo box is displayed by a Windows Presentation Foundation (WPF) application in Windows 8 or Windows Server 2012, this WPF window that owns the tooltip or drop-down combo box appears behind other windows. 


This issue occurs because the z-order position of the WPF window is changed incorrectly when it is the owner of a pop-up window that has the WS_EX_TOPMOST extended window style that is being displayed, such as a tooltip or a drop-down combo box. This behavior occurs when the owner window of the WPF window that is displaying a pop-up window is owned by another thread, and that other thread owns windows that have the WS_EX_TOPMOST window style.


The Microsoft .NET Framework 4.5.1 provides functionality that applications can opt into in order to avoid this problem in WPF applications. Add the following code to the WPF application’s app.config file in order to enable this functionality:
<?xml version="1.0" encoding="utf-8"?>
<add key="UseSetWindowPosForTopmostWindows" value="True" />