|
-
Oct 19th, 2000, 07:06 PM
#1
Thread Starter
New Member
I need a line control with a click event in the worst way! My application works great except that I need to allow the user to be able to erase any number of lines. Each line will be a member of a control array.
I recall reading that this is possible but can't seem to track the reference down.
Thanks
-
Oct 19th, 2000, 11:15 PM
#2
Hmmm....
Hi Dave.
I didn't read the thread, but I think I can help you.
Instead of using a click event on a line control (which does not have a click event, of course), draw the lines on your form (or pic box) and use math calculations to verify if the cursor is over a line or not on the click event of your form (or pic box).
line formula:
y = m * x + b where m is the inclination (delta_y/delta_x) and b is the "y" value when x = 0.
Once you have calculated m and b (which is easy enough when you have the X1, Y1, X2 and Y2 points of a line command), you should be able to verify if the cursor is over a line and then erase that line from the form and from your array as well.
I hope that's good enough...
Good luck!
-
Oct 20th, 2000, 12:03 AM
#3
Thread Starter
New Member
Thanks for trying. This is a geoboard application for kids. I have an 11 X 11 grid with lots and lots of differently colored line segments. I need for the user to be able to erase any given segment. I'm confident that the only way to handle this problem is to use line controls with click events. Right now I'm drawing the lines but can replace them with line controls once I can get them to respond to the user.
This problem can't be solved by checking the color of the segment either.
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|