不好意思说错了..我说的是单元格的数据为1 2 3 4
完成了,后来者可以来参考一下
this.dataGrid1.MouseUP += new System.Windows.Forms.MouseEventHandler(this.dataGrid1_MouseUp);
private void dataGrid1_MouseUp(object sender, EventArgs e)
{
DataGridCell myCell = new DataGridCell();
myCell.ColumnNumber = this.dataGrid1.CurrentCell.ColumnNumber;//返回选定列数
myCell.RowNumber = this.dataGrid1.CurrentCell.RowNumber;//返回选定行数
groupbox1.Location = Form1.MousePosition;//获取Form1的光标所在的坐标(label1放于groupbox1里)
label1.Text = this.dataGrid1[myCell].ToString();//返回指定单元格数据
}