lzh3452 你好,
- int prerow = 0;
- int precol = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- this.fpSpread1.Sheets[0].OperationMode = FarPoint.Win.Spread.OperationMode.RowMode;
- this.fpSpread1.FocusRenderer = null;
- }
- private void fpSpread1_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
- {
- e.Cancel = true;
- //reset 前一 ActiveCell 背景色。
- this.fpSpread1.Sheets[0].Cells[prerow, precol].ResetBackColor();
- fpSpread1.ActiveSheet.SetActiveCell(e.Row, e.Column);
- //这里设置背景色,当然可以和当前行颜色相同
- this.fpSpread1.Sheets[0].Cells[e.Row, e.Column].BackColor = Color.Red;
- prerow = e.Row;
- precol = e.Column;
- }
复制代码 |