private void XC_View_data_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right) //判断是不是右键
{
Control control = new Control();
Point ClickPoint = new Point(e.X, e.Y);
control.GetChildAtPoint(ClickPoint);
if (View_data.HitTest(e.X, e.Y).RowIndex >= 0 && View_data.HitTest(e.X, e.Y).ColumnIndex >= 0)//判断点的是不是一个行里
{
View_data.CurrentCell = View_data.Rows[View_data.HitTest(e.X, e.Y).RowIndex].Cells[View_data.HitTest(e.X, e.Y).ColumnIndex];
}
}
}
{
if (e.Button == MouseButtons.Right) //判断是不是右键
{
Control control = new Control();
Point ClickPoint = new Point(e.X, e.Y);
control.GetChildAtPoint(ClickPoint);
if (View_data.HitTest(e.X, e.Y).RowIndex >= 0 && View_data.HitTest(e.X, e.Y).ColumnIndex >= 0)//判断点的是不是一个行里
{
View_data.CurrentCell = View_data.Rows[View_data.HitTest(e.X, e.Y).RowIndex].Cells[View_data.HitTest(e.X, e.Y).ColumnIndex];
}
}
}