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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.