0

Hi,

I added a Rectangle to a Canvas like this:

Canvas.SetTop(myRectangle, 150);
Canvas.SetLeft(myRectangle, 80);
canvas.Children.Add(myRectangle);

Now I want to move the rectangle to other place, say (100, 100).
What is the best way to do this ?

Thanks !

1
Contributor
1
Reply
4
Views
8 Years
Discussion Span
Last Post by moroshko
0

I'll explain what I'm trying to do. I want user to be able to draw circles on a Canvas. First, user clicks somewhere on the Canvas to define circle's center. Then, when the mouse is moved, I would like to draw a circle according to the current mouse position (the radius is the distance between the current mouse position and the circle's center). I thought to implement this functionality by adding a new Ellipse to Canvas.Children, and then to move this Ellipse and change it's radius with each mouse movement. Am I on the right way ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.