selecting line drawn during runtime

shri_shri

Member
Joined
May 3, 2005
Messages
6
Programming Experience
Beginner
hi,

I have a line that is drawn during runtime.
How can i select this line?
The reason being I need to provide an option to delete this line at a later stage by selecting it with the mouse.
thanks.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,346
Location
Sydney, Australia
Programming Experience
10+
I don't know this for sure because I haven't ever tried, but I would guess that you cannot select a line simply by clicking it like you can a Control. When you use Graphics.DrawLine() there is no Line object to raise events on. My best guess would be to store the coordinates of the line in a variable and in the Form's MouseDown and/or MouseUp event handlers check the position of the cursor to see if your line was clicked on.
 
Top Bottom