回复 1楼huchunyan的帖子
通过 HitTestInformation 类获取点击信息,代码请参考:
- private void gcSpreadSheet1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
- {
- HitTestInformation info = gcSpreadSheet1.HitTest(e.GetPosition(gcSpreadSheet1).X, e.GetPosition(gcSpreadSheet1).Y);
- if (info.HitTestType == HitTestType.Corner)
- gcSpreadSheet1.Sheets[0].SetText(0, 0, "Click SheetCorner of control");
- if (info.HeaderInfo != null)
- {
- gcSpreadSheet1.Sheets[0].SetActiveCell(info.HeaderInfo.Row, info.HeaderInfo.Column);
- }
- else
- {
- gcSpreadSheet1.Sheets[0].SetActiveCell(info.ViewportInfo.Row, info.ViewportInfo.Column);
- }
- }
复制代码 |