设置XY而不是新厚度 [英] Set point of XY instead of New Thickness

查看:51
本文介绍了设置XY而不是新厚度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



目前在我的程序中,我已经设置了你在这里的设计,它按路径绘制路径,直到你是的完整图标这里并将所有这些路径分组到网格中。



现在在我的代码中,我会将网格(gd_youarehere)指向公众想去的位置。我当前的代码指出: -

Hi all,

Currently in my program, I have put a design of "You are here" which draw path by path until complete icon of "You are here" and group all of this path into Grid.

Now on my code, I will point the Grid (gd_youarehere) to location that public want to go. My current code for pointing this:-

you_are_here.Margin = New Thickness(1150.521, 375.903, 0, 0)



但是目前的要求需要我扩大你在这里一点点。它会影响电网的余量。所以,如果是这样的话,我需要通过逐个指向它来获取所有位置厚度并抓住边距。



有没有办法只指向XY如果可能的话?或者更好的方法,如果gd_youarehere需要调整大小?


But current requirement need me to enlarge the "you are here" a little bit. And it will effect the margin of the grid. So, if that so, I need to get all of location thickness back by pointing it one by one and grab the margin.

Is there any way to point only XY if possible? Or a better way than this in case the gd_youarehere need to resize?

推荐答案

如果你想要移动的东西,你应该真正使用画布;然后你可以设置一个UI元素的顶部和左边(而不用担心边距和尺寸)。



画布(以及其他对象)可以覆盖现有对象(使用网格单元格或其他画布)。在透明的背景下,你不需要做很多的摆弄来获得画布能力,其他东西仍然在后台使用其他技术。
If you want "move" stuff around, you should really be using a "Canvas"; then you can set the Top and Left of a UI element (and not worry about "margins" and "size").

Canvases (as well as other objects) can overlay existing objects (using grid cells or other canvases). With a transparent background, you don't need to do a lot of fiddling to get "canvas ability" with other things still going on in the background using other techniques.


这篇关于设置XY而不是新厚度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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