找回密码
 立即注册

QQ登录

只需一步,快速开始

gw0506

超级版主

181

主题

4212

帖子

9049

积分

超级版主

Rank: 8Rank: 8

积分
9049

活字格认证

gw0506
超级版主   /  发表于:2010-5-10 18:28  /   查看:7462  /  回复:1
下面的这段代码可以向左上角的单元格中添加文本。效果图如下:

jpg

jpg


[Visual Basic .NET Code]
Public Class SheetCorner
Inherits FarPoint.Win.Spread.CellType.GeneralCellType

    Public Overrides Sub PaintCell(ByVal g As System.Drawing.Graphics, ByVal r As System.Drawing.Rectangle, ByVal appearance As FarPoint.Win.Spread.Appearance, ByVal value As Object, ByVal isSelected As Boolean, ByVal isLocked As Boolean, ByVal zoomFactor As Single)
        MyBase.PaintCell(g, r, appearance, "Text", isSelected, isLocked, zoomFactor)
    End Sub
End Class

Dim sctextcell As New SheetCorner()
FpSpread1.Sheets(0).SheetCornerStyle.CellType = sctextcell


[C# Code]
class CornerCell : 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, "Text", isSelected, isLocked, zoomFactor);
    }
}

CornerCell sctextcell = new CornerCell();
fpSpread1.Sheets[0].SheetCornerStyle.CellType = sctextcell;

1 个回复

倒序浏览
op8237116
初级会员   /  发表于:2014-2-10 10:43:00
沙发
学习学习!!!
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部