按钮跟随窗口的右上角 [英] Make button follow top right corner of window

查看:120
本文介绍了按钮跟随窗口的右上角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有几个控件的窗口,包括一个按钮和一个图像。当我单击按钮时,将打开一个新的全屏窗口,其中包含一个灰色的透明度和一个居中的图像。我有一个关闭按钮来关闭图像形式,但我需要它来跟踪图像的右上角,因为它变大了。就像您点击图片的网站上的图片查看器一样,它会在页面上打开图像,并且透明度变暗,并且在角落后面的角落处有一个关闭按钮。我该怎么做?我需要按钮在图像更改大小时保留在图像的右上角。谢谢,希望这是有道理的。

解决方案

有很多选项,使用Grid布局将允许这个(就像一个网页)。有一个底板,可以让你通过填充将控制停靠在顶部,底部,右侧和左侧。



你不能做的是使用绝对定位。 / BLOCKQUOTE>

I have a window with a few controls including a button and an image. When I click the button a new full screen window opens with a slight grey transparency and an image that is centred in it. I have a close button to close the image form but I need it to 'track' the top right corner of the image as it changes bigger. Like image viewers on websites where you click an image and it opens the image over the page with a dimmed transparency and it has a close button in the corner which follows the corner. How would I do this? I need the button to stay in the top right corner of the image when it changes size. Thank you and hope this makes sense.

解决方案

There are a number of options, using a Grid layout will allow this (just like a web page). There is a dockpanel that will allow you to dock control to the top,bottom,right and left with a fill.

What you cannot do is use absolute positioning.


这篇关于按钮跟随窗口的右上角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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