如何根据鼠标的X、Y坐标 获取单元格
如何根据鼠标的X、Y坐标 获取单元格 :bt^j: 回复 2楼pjsLucky的帖子让您久等了。
void gcSpread1_MouseDown(object sender, MouseButtonEventArgs e)
{
HitTestInformation info = gcSpreadSheet1.HitTest(e.GetPosition(gcSpreadSheet1).X, e.GetPosition(gcSpreadSheet1).Y);
if (info.HitTestType == HitTestType.Corner)
gcSpreadSheet1.Sheets .SetText (0,0,"Click SheetCorner of control");
if (info.HeaderInfo != null)
{
if (info.HeaderInfo.InColumnResize)
gcSpreadSheet1.Sheets.SetText(0, 0, "Column" + info.HeaderInfo.Column.ToString() + " is resizing");
else if (info.HeaderInfo.InRowResize)
gcSpreadSheet1.Sheets.SetText(0, 0, "Row" + info.HeaderInfo.Row.ToString() + " is resizing");
}
}
页:
[1]