ioustinos_sarris
asked on
Make line clickable VB.NET
Hi there, i am drawing some lines on a System.Drawing.Graphics object.
for example
I want that line to be clickable and run a function when its clicked.
Any ideas?
for example
gMyGraphics.DrawLine(pMyPen, 0 + lineStartMargin, lineYpos, lineWidth + lineStartMargin, lineYpos)
I want that line to be clickable and run a function when its clicked.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1) Keep the points at which the line exists and when mouse is clicked within the container of the line, get the coordinates and if the coordinates match with any of those of the line then execute the function you want.
2) Use a control such as label instead of drawing a line. This will obviously work only if you want to draw a straight horizontal line.