Someone can correct me if I'm wrong, but it's going to be complicated, I think.
First, I assume you're using the
LineShape
from within the Visual Basic PowerPacks? (and yes, I know this is a C# ?)
Even if you're not and just drawing a line on the form programmatically, you're going to have to use either the form's drag events, or the container that it is drawn on.
Assuming you already have a
PictureBox
being dragged, first hook the Form's
DragEnter
and
DragOver
events and in that code, first, check if there is a
PictureBox
present
if (e.Data.GetDataPresent(typeof(PictureBox))
then you have to check if it's over the line. If it's a
LineShape
from the VB PowerPacks, you can do a
HitTest
if (lineShape1.HitTest(e.x,e.y))
Then, you set
e.Effect
to what effect you want. Then, you handle the
DragDrop
in the form and add the
PictureBox
to the line that the
DragDrop
happened over.