回复 1楼year2001的帖子
需要先获取当前的 Selection 在进行单元格范围的外侧边框设置:
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.SelectionChanged += fpSpread1_SelectionChanged;
- }
- void fpSpread1_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
- {
- CellRange cr = this.fpSpread1.Sheets[0].GetSelection(0);
- //设置外围上边框
- fpSpread1.Sheets[0].Cells[cr.Row, cr.Column, cr.Row, cr.Column + cr.ColumnCount-1].Border = new FarPoint.Win.DoubleLineBorder(Color.Red, false, true, false, false);
- }
复制代码 |