|
-
Mar 13th, 2023, 12:06 PM
#1
Thread Starter
Addicted Member
Drawing lines
I am working on a program, just for fun, and have run into an issue I cannot resolve. The issue is simply this: When I try drawing a line over several Labels, the line only appears over the first Label.
In an earlier version of the program, the Labels were Buttons, but based on some reading (which suggested that lines cannot be drawn over Buttons), I changed the controls from Button to Label, but that did not help.
Attached is a simplified version of the code – I removed most everything I could and still have it function. To see the problem, run the program and then do this:
- Click the ‘Add Buttons’ button.
- Click at least two of the squares in the grid and note that all squares selected must have adjoining edges. Start with just two squares for simplicity.
- Click the ‘Build Path’ button.
What happens is that when you click the squares in the grid, their location is noted. When you click ‘Build Path’, the routine buildPath_Click figures out the corners of the line (which should be a dashed line around/inside the selected squares), and then draws the line.
Please don’t laugh too much at the code and please provide some suggestions as to how I can make this work.
Tags for this Thread
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
|