回复 1楼lnp119112555的帖子
抱歉,Winforms 平台无法通过设计器更改表头的背景色,需要通过代码实现。代码如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- EmptyCellType ect = new EmptyCellType();
- this.fpSpread1.Sheets[0].ColumnHeader.Rows[0].CellType = ect;
- this.fpSpread1.Sheets[0].RowHeader.Columns[0].CellType = ect;
- //this.fpSpread1.Sheets[0].cellchange
- }
- private void fpSpread1_CellClick(object sender, CellClickEventArgs e)
- {
- int selRow=e.Row;
- int selCol=e.Column;
- FarPoint.Win.Spread.StyleInfo darkstyle = new FarPoint.Win.Spread.StyleInfo();
- darkstyle.BackColor = Color.Purple;
- this.fpSpread1.Sheets[0].ColumnHeader.Cells[0,selCol].BackColor = Color.Purple;
- this.fpSpread1.Sheets[0].RowHeader.Cells[selRow, 0].BackColor = Color.Purple;
- }
复制代码 |