kriswinner
Member
- Joined
- Apr 23, 2009
- Messages
- 23
- Programming Experience
- 10+
I'm using the DataGridView control to display a table of textboxes and comboboxes. In one of the combobox columns, I need to popup a form when that cell is (left) clicked. I have that portion working.
The part that I have issue with is locating the popup form properly.
In the _CellClick event, I test to see which column was clicked. If it was the appropriate column, I capture the .MousePosition.X and .Y position and set the form's location based on that. As you would expect, the form is displayed at the exact location that I click the cell. I would like to be able to have the form display in the same location relative to the cell regardless of where in the cell I click.
Is there somewhere I can get the location of one of the corners of the cell (a "fixed" point) that I can use to consistently position the form?
The part that I have issue with is locating the popup form properly.
In the _CellClick event, I test to see which column was clicked. If it was the appropriate column, I capture the .MousePosition.X and .Y position and set the form's location based on that. As you would expect, the form is displayed at the exact location that I click the cell. I would like to be able to have the form display in the same location relative to the cell regardless of where in the cell I click.
Is there somewhere I can get the location of one of the corners of the cell (a "fixed" point) that I can use to consistently position the form?