你好,请尝试以下代码:- FarPoint.Win.Spread.Model.CellRange preRange;
- private void fpSpread1_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
- {
- FarPoint.Win.LineBorder resetBorder = new FarPoint.Win.LineBorder(System.Drawing.Color.Black,0);
- if (preRange!=null)
- {
- this.fpSpread1.Sheets[0].SetOutlineBorder(preRange, resetBorder);
- }
- FarPoint.Win.Spread.Model.CellRange selectCellRange = e.Range;
- FarPoint.Win.LineBorder selectBorder = new FarPoint.Win.LineBorder(System.Drawing.Color.Red);
- this.fpSpread1.Sheets[0].SetOutlineBorder(selectCellRange, selectBorder);
- preRange = e.Range;
- }
复制代码 |