找回密码
 立即注册

QQ登录

只需一步,快速开始

远光软件

初级会员

47

主题

119

帖子

378

积分

初级会员

积分
378

活字格认证

远光软件
初级会员   /  发表于:2015-8-14 15:47  /   查看:5374  /  回复:5
插入带格式表格(性能低:
代码片段
"private void cmdOK_Click(object sender, System.EventArgs e)
        {
            DateTime dtStart = DateTime.Now;
            int newTableID = 10 + tx.Tables.Count;
            int rows = (int)updownRows.Value;
            int columns = (int)updownColumns.Value;
            this.tx.Tables.Add(rows, columns, newTableID);           
            this.SetTableDefaultFormat(newTableID);          // 设置表格的默认格式           
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
private void SetTableBorderWidthTextDistance(Table table)
        {
            tx.SuspendLayout();
            foreach (TableCell cell in table.Cells)
            {
                 cell.CellFormat.TopBorderWidth =15; //0.75pt
                 cell.CellFormat.BottomBorderWidth =15; //0.75pt
                 cell.CellFormat.LeftBorderWidth =15; //0.75pt
                 cell.CellFormat.RightBorderWidth =15; //0.75pt
               
                cell.CellFormat.TopTextDistance = cell.CellFormat.BottomTextDistance =
                    cell.CellFormat.LeftTextDistance = cell.CellFormat.RightTextDistance = 30;

                cell.CellFormat.TopBorderColor = cell.CellFormat.BottomBorderColor =
                    cell.CellFormat.LeftBorderColor = cell.CellFormat.RightBorderColor = Color.Black;
            }
            tx.ResumeLayout();
        }"
插入带格式表格(性能低).jpg

5 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2015-8-14 17:08:00
沙发
回复 1楼远光软件的帖子

问题已经重现了,我会发送给厂商,询问是否有什么优化方法。
收到反馈后第一时间通知你。
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-8-21 11:54:00
板凳
回复 1楼远光软件的帖子

由于目前没有直接有效的减少性能消耗的办法,建议您分批进行表格的创建和格式化:
1.在 ServerTextControl 中创建10×10行列并格式化
2.添加到 TextControl 中
3.重复1、2步骤直至完成表格添加。
回复 使用道具 举报
远光软件
初级会员   /  发表于:2015-8-24 08:49:00
地板
我要的是 一个表格 100行* 10列,而不是10*10 的多个表格,能实现吗,最好给个demo
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-8-24 16:14:00
5#
回复 4楼远光软件的帖子

很抱歉给你带来的不便。
目前没有已经实现的示例。
基本思路请参考3楼所示的步骤,它是通过创建少的行列并多次重复实现。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2015-9-2 09:22:00
6#
回复 4楼远光软件的帖子

为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部