You need to control the "Z-order" of windows in a WPF application

I have an application that, due to OpenGL airspace issues, needs to contain multiple controls in separate exclusive windows. This works really well, but I set all windows to TopMost = true

, which means they stay showy even when they lose focus, but also overlap other applications. Also, it somehow tethers me to using only one window at a time for this. Activate()

doesn't work either.

+2


source to share


2 answers


I found that setting window owners to the main application window allowed them to always float on top.

Inside a control that mediates the content and dimension of the child window:



InnerWindow.Owner = Window.GetWindow(this);

      

this

is the windowHostControl that hosts this window.

+2


source


I am using to combine Activate () and Focus () methods to show a hidden window. Can you try using Focus () and let us know if it works?



0


source







All Articles