也可以使用如下方法:
public Form1()
{
InitializeComponent();
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = new MyEnhancedColumnHeaderRenderer();
fpSpread1.ActiveSheet.RowHeader.DefaultStyle.Renderer = new MyEnhancedRowHeaderRenderer();
}
private class MyEnhancedColumnHeaderRenderer : FarPoint.Win.Spread.CellType.EnhancedColumnHeaderRenderer
{
public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
{
appearance.ContainsSelection = false;
base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
}
}
private class MyEnhancedRowHeaderRenderer : FarPoint.Win.Spread.CellType.EnhancedRowHeaderRenderer
{
public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
{
appearance.ContainsSelection = false;
base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
}
} |