I have got a collection of lines on a form each called Line1(i), I want to be able to click the mouse on one of the lines and be able to retrieve properties about this line. Can this be done and if it can, how do i do it?? help somebody, please
Printable View
I have got a collection of lines on a form each called Line1(i), I want to be able to click the mouse on one of the lines and be able to retrieve properties about this line. Can this be done and if it can, how do i do it?? help somebody, please
I really don't know, it's just an idea:
I think it should work... try it out ;)Code:Dim A As Long
'X and Y are the mouse coordinates
For A = 0 to Line1.Count - 1
If (Y-Line1(A).Y1) / (X-Line1(A).X1) = (Line1(A).Y2-Y) / (Line1(A).X2-X) Then
'Mouse is on line
EndIf
Next
[Edited by Fox on 04-05-2000 at 07:22 PM]
Uh sorry,
I just tested my code and it works only for lines from top-left to lower-right... anyway, hope I helped ya ;) (I'm sure you can modify the code for the other destinations)