How do I to get the current cell position x and y in a DataGridView?

后端 未结 4 958
情深已故
情深已故 2020-12-31 07:24

I have a Windows form with a calendar which is hidden. I want to show the form right under the current cell of a DataGridView. The position changes according to the position

4条回答
  •  青春惊慌失措
    2020-12-31 07:42

    You can use paygrid.PointToScreen() method.

    form_date.Location = paygrid.PointToScreen(
       paygrid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Location);
    

提交回复
热议问题