回复 3楼HIFRANK的帖子
这个需求可以通过插入 Table 来模拟这个功能,代码如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- this.textControl1.Text = "";
- int tableID = 10;
- textControl1.Tables.Add(6, 1, tableID);
- TXTextControl.Table table = textControl1.Tables.GetItem(tableID);
- this.textControl1.Tables.GridLines = false;
- table.Cells.GetItem(1, 1).Text = "问:";
- table.Cells.GetItem(2, 1).Text = "答:";
- table.Cells.GetItem(3, 1).Text = "问:";
- table.Cells.GetItem(4, 1).Text = "答:";
- table.Cells.GetItem(5, 1).Text = "问:";
- table.Cells.GetItem(6, 1).Text = "答:";
- foreach (TableCell cell in this.textControl1.Tables.GetItem(10).Cells)
- {
- if (cell.Column == 1)
- {
- cell.CellFormat.LeftBorderWidth = 0;
- cell.CellFormat.RightBorderWidth = 0;
- cell.CellFormat.TopBorderWidth = 0;
- cell.CellFormat.BottomBorderWidth = 1;
- }
- }
- }
复制代码
效果图:
|