请尝试如下代码。- 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;
复制代码 |