Click here to Skip to main content
15,606,811 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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)

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?

1 solution

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.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900