回复 3楼孙增东的帖子
定制排序指示器方法请参考,代码中手动绘制了图形,也可以用图片填充:
- private void Form1_Load(object sender, System.EventArgs e)
- {
- fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Renderer = new myColumnHeaderRenderer();
- fpSpread1.Sheets[0].Columns[0].AllowAutoSort = true;
- }
- public class myColumnHeaderRenderer : FarPoint.Win.Spread.CellType.ColumnHeaderRenderer
- {
- override public void PaintSortIndicator(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, float zoomFactor)
- {
- g.FillRectangle(new SolidBrush(Color.Red), r);
- }
- override public void PaintFilterIndicator(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, float zoomFactor)
- {
- g.FillRectangle(new SolidBrush(Color.Blue), r);
- }
- }
复制代码 |