银色光子窗

发布于 2024-08-31 01:39:06 字数 34 浏览 1 评论 0原文

我怎样才能让我的childWindow始终位于最上面?

how can i do my childWindow to be always on top?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风筝在阴天搁浅。 2024-09-07 01:39:06

如果您所说的 ChildWindows 是指 Silverlight 中的 ChildWindow 对象,那么它应该始终显示在顶部,如 文档 说:

子窗口总是显示在
阻止用户的模式弹出窗口
与底层用户的交互
界面。

但是,如果 ChildWindow 您指的是在 Silverlight 中创建的其他内容,那么您需要设置 ZIndex 该对象的属性为一个非常大的数字:

对象的 z 顺序决定
物体是否在前面或
在另一个重叠的物体后面。经过
默认情况下,对象的 z 顺序
一个Panel是由顺序决定的
其中声明了它们。对象
稍后声明的内容出现在
声明的对象前面
早些时候。您可以更改此行为
通过设置 Canvas..::.ZIndex
内对象的附加属性
专家组。值越高越接近
前景;较低的值是
离前景较远。

在代码隐藏中,您可以编写:

myObject.SetValue(Canvas.ZIndexProperty, 100); 

在 XAML 中,您需要编写

<Rectangle Canvas.ZIndex="100" />

If by ChildWindows you mean the ChildWindow object in Silverlight then it should always appear on top, as the documentation says:

A ChildWindow always displays in a
modal popup that blocks user
interaction with the underlying user
interface.

But if by ChildWindow you mean something else you created in Silverlight then you need to set the ZIndex property of that object to a very big number:

The z-order of an object determines
whether the object is in front of or
behind another overlapping object. By
default, the z-order of objects within
a Panel is determined by the sequence
in which they are declared. Objects
that are declared later appear in
front of objects that are declared
earlier. You can change this behavior
by setting the Canvas..::.ZIndex
attached property on objects within
the Panel. Higher values are closer to
the foreground; lower values are
farther from the foreground.

In codebehind you would write:

myObject.SetValue(Canvas.ZIndexProperty, 100); 

and in XAML you would need to write

<Rectangle Canvas.ZIndex="100" />
在你怀里撒娇 2024-09-07 01:39:06

也许 Popup 控件会对您有所帮助?
http://jesseliberty.com//2008/06/06/popup-control /

Maybe Popup control will help you?
http://jesseliberty.com//2008/06/06/popup-control/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文