WPF 始终在父级之上 [英] WPF always on top only for parent

查看:27
本文介绍了WPF 始终在父级之上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的窗户总是在最上面,但只是为了他的父母.

I need my window to be always on top but just for his parent.

是否可以只为父级设置一个窗口总是在顶部?

Is it possible to make a window always on top just for the parent ?

推荐答案

设置子窗口的 Owner 属性,指向打开窗口.这样,它将始终位于其父级之上.

Set the Owner property of your child window, pointing to the opener window. This way it will always be on top of its parent.

SomeWindow childWindow = new SomeWindow();
childWindow.Owner = this;
childWindow.Show();

这篇关于WPF 始终在父级之上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆