laonawuli 你好,有两种方式可以实现该功能:
1. 使用设计器添加直线,应用并退出。
2. 应用代码实现:
- int width =(int) (this.fpSpread1.ActiveSheet.Columns[0].Width + this.fpSpread1.ActiveSheet.Columns[1].Width) ;
- int height =(int)( this.fpSpread1.ActiveSheet.Rows[0].Height + this.fpSpread1.ActiveSheet.Rows[1].Height);
- FarPoint.Win.Spread.DrawingSpace.LineShape line = new FarPoint.Win.Spread.DrawingSpace.LineShape();
- line.Name = "mark";
- line.ShapeOutlineColor = Color.Red;
- line.SetBounds(0, 0, width, height);
- line.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
- this.fpSpread1.ActiveSheet.AddShape(line);
复制代码 效果图
png
|