> a code which creates a Line object on a Form
1) add a line object, make it an array (set Index property to 0 - like line1 should become line1(0))
You can make it invisible or put out of bounds of form.
2) make a global var LC (LineCounter), set it to 0
3)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
LC = LC + 1
Load Line1(LC)
With Line1(LC)
.X1 = X
.Y1 = Y
.X2 = X + Rnd * 1000 - 500
.Y2 = Y + Rnd * 1000 - 500
.Visible = True
End With
End Sub
Well, it was quick example - you have to tailor it to your needs.