✅ In a WPF application, how do you keep a modal window above all other windows for that app?
I only want that window on top of other windows for that application, not on top of everything.
9 Replies
there's a
Topmost
property in the Window
class, set that to true
not sure about the order of other topmost windows though, afaik what windows does internally store an order index, so maybe setting topmost to false then back to true will re-order it to the very topUh, wouldn't that be on top of more than just my app? I just want to keep it in front of my main window.
oh i misread the message
it seems like it is possible in windows but you'd have to do some unsafe things using window handles
As is, when I move the focus to another app and then back to the main window, the dialog is hidden.
Ugh.
the user32
SetWindowPos
takes the hWnd, hWndInsertAfter, X, Y, etc.Stack Overflow
How to make a WPF window be on top of all other windows of my app (...
I want my window to be on top of all other windows in my application only. If I set the TopMost property of a window, it becomes on top of all windows of all applications and I don't want that.
apparently if you set the window's Owner property then it might do what you want
Oh.
That explains that.
Been too long.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.