开发者

Child wpf window above parent window

开发者 https://www.devze.com 2023-03-25 04:01 出处:网络
I have WPF application with main window. I want to create child WPF window which always must be above ONLY parent window. If I set TopMost property for new window then window开发者_开发知识库 is above

I have WPF application with main window. I want to create child WPF window which always must be above ONLY parent window. If I set TopMost property for new window then window开发者_开发知识库 is above ALL nonTopMost windows on desktop. It's not what I want.


Set the Owner property of the child window so that it refers to the parent window.

child.Owner = parent;


Depending on the nature of the window, I often use a "Fake" window that is really just a layer in the parent along with a partailly transparent grey layer between that makes the parent look ghosted while the child is active. You can then keep the child window set to collapsed until it is needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号