Spread 添加 SheetConer 文字

发布时间:2012/11/13 00:11 发布者:葡萄城产品团队

返回博客中心

下面的代码实现给 SheetConer 添加文字,先上截图:

代码:

 
private void Form1_Load(object sender, EventArgs e)

        {

            this.fpSpread1.Sheets[0].SheetCornerStyle.CellType=new ConerCellType();

            this.fpSpread1.Sheets[0].SheetCorner.Columns[0].Width = 50;

            this.fpSpread1.Sheets[0].SheetCorner.Rows[0].Height = 50;

        }

    }

    class ConerCellType : 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, "测试文字", isSelected, isLocked, zoomFactor);

        }

    }

复制代码

Demo 下载:
测试环境:
VS 2010 && Spread for WinForm 5.0

SetConerText.zip (37.99 K, 下载次数:15)

关于葡萄城

赋能开发者!葡萄城是专业的集开发工具、商业智能解决方案、低代码开发平台于一身的软件和服务提供商,为超过 75% 的全球财富 500 强企业提供服务。葡萄城专注控件软件领域30年,希望通过模块化的开发控件、灵活的低代码应用开发平台等一系列开发工具、解决方案和服务,帮助开发者快速响应复杂多变的业务需求,最大程度地发挥开发者的才智和潜能,让开发者的 IT 人生更从容更美好。

了解详情,请访问葡萄城官网