Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


Symptoms

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. 

↑ Back to the top


Cause

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.

↑ Back to the top


Resolution

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"?>
<configuration>
<appSettings>
<add key="UseSetWindowPosForTopmostWindows" value="True" />
</appSettings>
</configuration>

↑ Back to the top


Keywords: kbsurveynew, kbtshoot, kbexpertiseinter, kb

↑ Back to the top

Article Info
Article ID : 2954125
Revision : 1
Created on : 1/7/2017
Published on : 4/21/2014
Exists online : False
Views : 59