回复 2楼p332718873的帖子
问题二可以通过以下代码实现:
- public MainPage()
- {
- InitializeComponent();
- this.GCSpreadSheet1.MouseRightButtonDown += new MouseButtonEventHandler(GCSpreadSheet1_MouseRightButtonDown);
- }
- void GCSpreadSheet1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
- {
- Point clickPosition = e.GetPosition(this.GCSpreadSheet1);
- HitTestInformation hitTest = this.GCSpreadSheet1.HitTest(clickPosition.X, clickPosition.Y);
- this.GCSpreadSheet1.Sheets[0].SetActiveCell(hitTest.ViewportInfo.Row,hitTest.ViewportInfo.Column);
- }
复制代码 |