Poppa Mintin
Well-known member
- Joined
- Jan 4, 2018
- Messages
- 45
- Programming Experience
- 10+
Hi,
I have a Windows form with 24 PictureBoxes.
If the user clicks any one of these I would like to detect when the cursor exits that box.
Now of course I could make 24 subroutines, one for each picturebox, but that seems a little inelegant.
So... I'm trying to find how to get the size and location of the rectangle of the clicked box. Obviously I know which box has been clicked, but can't find how to get it's rectangle on the screen. The PictureBoxes are all in a TableLayoutPanel, and have their Dock set to full, but I can't find how to use that either.
When a box is clicked I will display a label, and then hide the label again once the cursor has left the rectangle. Then I shall face the question of what to do with the application while I'm waiting for the cursor the leave that location. Can I just use a 'While the cursor is within this rectangle' loop and put nothing in the loop ?
Poppa.
I have a Windows form with 24 PictureBoxes.
If the user clicks any one of these I would like to detect when the cursor exits that box.
Now of course I could make 24 subroutines, one for each picturebox, but that seems a little inelegant.
So... I'm trying to find how to get the size and location of the rectangle of the clicked box. Obviously I know which box has been clicked, but can't find how to get it's rectangle on the screen. The PictureBoxes are all in a TableLayoutPanel, and have their Dock set to full, but I can't find how to use that either.
When a box is clicked I will display a label, and then hide the label again once the cursor has left the rectangle. Then I shall face the question of what to do with the application while I'm waiting for the cursor the leave that location. Can I just use a 'While the cursor is within this rectangle' loop and put nothing in the loop ?
Poppa.