下面的代码实现给 SheetConer 添加文字,先上截图:
代码:
private void Form1_Load(object sender, EventArgs e) { this.fpSpread1.Sheets[0].SheetCornerStyle.CellType=new ConerCellType(); this.fpSpread1.Sheets[0].SheetCorner.Columns[0].Width = 50; this.fpSpread1.Sheets[0].SheetCorner.Rows[0].Height = 50; } } class ConerCellType : FarPoint.Win.Spread.CellType.GeneralCellType { public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor) { base.PaintCell(g, r, appearance, "测试文字", isSelected, isLocked, zoomFactor); } } 复制代码
Demo 下载:
测试环境:
VS 2010 && Spread for WinForm 5.0