那我以All Border为例,代码如下。- CellRange cr = this.fpSpread1.ActiveSheet.GetSelection(0);
- for (int i = cr.Row; i < cr.Row + cr.RowCount; i++)
- {
- for (int j = cr.Column; j < cr.Column + cr.ColumnCount; j++)
- {
- this.fpSpread1.ActiveSheet.Cells[i, j].Border = new LineBorder(Color.Red, 2);
- }
- }
复制代码 |