实现CellClick事件
- fpSpread1.CellClick += FpSpread1_CellClick;
-
- private void FpSpread1_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
- {
- if (e.Button == MouseButtons.Right && e.RowHeader == false && e.ColumnHeader == false)
- {
- fpSpread1.ActiveSheet.SetActiveCell(e.Row, e.Column, true);
- }
- if (e.Button == MouseButtons.Right && e.RowHeader == true && e.ColumnHeader == false)
- {
- fpSpread1.ActiveSheet.SetActiveCell(e.Row, 0, true);
- fpSpread1.ActiveSheet.AddSelection(e.Row, 0, 1, fpSpread1.ActiveSheet.ColumnCount);
- }
- if (e.Button == MouseButtons.Right && e.RowHeader == false && e.ColumnHeader == true)
- {
- fpSpread1.ActiveSheet.SetActiveCell(0, e.Column, true);
- fpSpread1.ActiveSheet.AddSelection(0, e.Column, fpSpread1.ActiveSheet.ColumnCount, 1);
- }
- }
复制代码 |