2 つの長方形を結ぶ直線を作成するにはどうすればよいでしょうか? 現時点では、私はこれを持っています:
if (listBox1.Items.Count >= 2)
{
e.Graphics.DrawLine(Pens.AliceBlue, new Point(/*??*/), new Point(n._x, n._y));
}
With the second new Point being where I placed my new Rectangle but I am not sure how to get the point of the Rectangle beforehand.
My rectangles X and Y are stored in a list like so:
public BindingList<Node> nodeList = new BindingList<Node>();
My main goal would be too add a line to each of my rectangles as they are drawn.
For example: Place one rectangle down, nothing happens, place another one down, add a line connecting the two, add a third, add a line connecting the second and third one together. But if I can get one going I can try and work out how to continuously add these lines.
Thanks for any help!