adjust arrow to form's location

  • Thread starter Thread starter avivgood
  • Start date Start date
A

avivgood

Guest
I have two forms, SelectedNode and SelectedNode2. I want to draw an arrow from the seconde form to the first form.

For that I have used:

public void Draw( float X1, float Y1, float X2, float Y2)
{
Pen pen = new Pen(Color.FromArgb(255, 0, 0, 255), 8);
pen.StartCap = LineCap.ArrowAnchor;
pen.EndCap = LineCap.RoundAnchor;
CreateGraphics().DrawLine(pen, X1, Y1, X2, Y2);
}

and implemented using:

Draw(SelectedNode.DesktopLocation.X, SelectedNode.DesktopLocation.Y, SelectedNode2.DesktopLocation.X, SelectedNode2.DesktopLocation.Y);

But when I tried to move one of the forms the arrow stayed in place and not synchronized with the location of the form

How can I make it synchronized ?

Continue reading...
 
Back
Top