yangjianlang 发表于 2016-3-3 00:14:00

使用什么函数使表格中的文字左对齐


版主:图片中“家族史”那行使用什么函数使表格中的文字左对齐?谢谢指导!

gw0506 发表于 2016-3-3 15:09:00

int tableID = 10;
textControl1.Tables.Add(6, 3, tableID);
TXTextControl.Table table = textControl1.Tables.GetItem(tableID);
table.Cells.GetItem(1, 1).Text = "Date / Time";
table.Cells.GetItem(1, 2).Text = "Customer data";
table.Cells.GetItem(1, 3).Text = "Result";
textControl1.Selection.Start = table.Cells.GetItem(1, 1).Start - 1;
textControl1.Selection.Length = table.Cells.GetItem(1, 3).Start - 1
                               + table.Cells.GetItem(1, 3).Length;
textControl1.Selection.Bold = true;
textControl1.Selection.ParagraphFormat.Alignment = TXTextControl.HorizontalAlignment.Center;
textControl1.Selection.Length = 0;

yangjianlang 发表于 2016-3-5 00:11:00

回复 2楼gw0506的帖子

问题已解决,谢谢!在TX Active中是Alignment=0有效。

gw0506 发表于 2016-3-8 17:44:39

好的,本帖关闭。
页: [1]
查看完整版本: 使用什么函数使表格中的文字左对齐