获取datagridview 对应cell的位置坐标

            Rectangle rect = dgv_User.GetCellDisplayRectangle(dgv_User.CurrentCell.ColumnIndex, dgv_User.CurrentCell.RowIndex, false);
            
string sexValue = dgv_User.CurrentCell.Value.ToString();
            
if (sexValue == "1")
            {
                cmb_Temp.Text 
= "";
            }
            
else
            {
                cmb_Temp.Text 
= "";
            }
            cmb_Temp.Left 
= rect.Left;
            cmb_Temp.Top 
= rect.Top;
            cmb_Temp.Width 
= rect.Width;
            cmb_Temp.Height 
= rect.Height;
            cmb_Temp.Visible 
= true;
 

 

你可能感兴趣的:(datagridview)