We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.

how to place node at specified coordinates

Replies:

78111 Nov 28,2008 02:40 PM UTC Dec 1,2008 02:29 PM UTC WinForms 4
 Subscribe to this post Tags: Diagram
MagicXtr
Asked On November 28, 2008 02:40 PM UTC

Hi,

Is there any way to set the location of node by specifying its coordinates (in descktop version of the diagram)? If there is no such posibility I would like to suggest to add it

Thanks a lot,
Bork

Replied On November 28, 2008 03:52 PM UTC

Hi Bork,

To place the nodes at some co ordinate point, use the following code snippet:

**********
Rectangle node, for example:
Rectangle rect = new Rectangle(0,0,100,150);

Set Coordinate location:
rect.PinPoint = new PointF(200,200);

**********

I am confident that this will resolve your query.

Happy Coding!

- Ajeet

Ron Alan Sawyer
Replied On November 29, 2008 01:04 AM UTC

Note that the PinPointOffset is important as well. If it is set to 0,0 then

rect.PinPoint = new PointF(200,200);

Will set the upper left hand corner of your rect to 200,200.

MagicXtr
Replied On December 1, 2008 08:16 AM UTC

Thanks a lot. I've found another method also: node.Translate(x, y);

Replied On December 1, 2008 02:29 PM UTC

Hi RAS,

The PinPointOffset is used to specify the "Centre of mass" for the selected Node, i.e. it defines the point keeping which constant, the rotate handle works.

Happy coding!

- Ajeet

>Note that the PinPointOffset is important as well. If it is set to 0,0 then

rect.PinPoint = new PointF(200,200);

Will set the upper left hand corner of your rect to 200,200.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.