您好
1. 获取锁定列您可以参考下面代码
- private void FpSpread1_CellDoubleClick(object sender, CellClickEventArgs e)
- {
- if (e.ColumnHeader == true)
- {
- if (fpSpread1.ActiveSheet.Columns[e.Column].Locked)
- {
- // your code
-
- }
- }
- }
复制代码
2. 加图片
fpSpread1.ActiveSheet.ColumnHeader.Cells[0, 0].CellType = new ImageHeader();
- public class ImageHeader : TextCellType
- {
- 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, value, isLocked, isLocked, zoomFactor);
- var rr = new Rectangle(r.X+ r.Width - 10, r.Y, 10, r.Height);
- TextureBrush b2 = new TextureBrush(Image.FromFile(@"C:\Users\DexterYao\Desktop\gc_sparkle-gen._UY80_QL95_.jpg"));
-
- g.FillRectangle(b2, rr);
- //g.FillRectangle(new SolidBrush(Color.Red), rr);
- }
- }
复制代码 |