|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Screen coordinates of selected datagridview cells left and top bordersHi All
How do I get the screen coordinates of the selected cell boundaries in a datagridview I need to position a form at the top left position of the selected cell regardless of where the user clicks in the cell Regards Steve do u mean this:
me.DataGridView1.SelectedCells(0).ContentBounds.Location steve wrote: Show quoteHide quote > Hi All > > How do I get the screen coordinates of the selected cell boundaries in a > datagridview > > I need to position a form at the top left position of the selected cell > regardless of where the user clicks in the cell > > > Regards > Steve Hi Steve ,
Thanks for your post! I think Ahmed has pointed out the correct direction. me.DataGridView1.SelectedCells(0).ContentBounds will provide the bounding rectangle that encloses the cell's content area. If you want to get the rectangle that represents the display area for a cell, you may give DataGridView.GetCellDisplayRectangle a try. Pass in the selected cell's row and column index. To get the screen coordinate, you may use DataGridView.PointToScreen method to convert the location point. Hope this helps! Best regards, Jeffrey Tan Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
Error converting FILETIME to DateTime
Report viewer Page margins problem two-dimensional arrays Read text-segment from binary file line breaks Where is Page.RegisterClientScriptBlock Available? richtextbox selectedtext bold upper .... how to find out Tabindex is driving me nuts!!! creating code on the fly at runtime How to get all files from http server |
|||||||||||||||||||||||