回复 9楼xingaoyang的帖子
本身Cell1 的边框并没有消失。调整后重现出现是正常现象。
这种情况需要通过 Changed 事件来重现设置:
- private void Form1_Load(object sender, EventArgs e)
- {
- textControl1.Tables.Add(3, 5, 1001);
- Table table = textControl1.Tables.GetItem(1001);
- TableCell cell1 = table.Cells.GetItem(2, 2);
- TableCell cell2 = table.Cells.GetItem(2, 3);
- cell1.Width = cell1.Width + cell2.Width;
- cell2.Width = 0;
- this.textControl1.Changed += new EventHandler(textControl1_Changed);
- }
- void textControl1_Changed(object sender, EventArgs e)
- {
- Table table = textControl1.Tables.GetItem(1001);
- TableCell cell1 = table.Cells.GetItem(2, 2);
- TableCell cell2 = table.Cells.GetItem(2, 3);
- cell1.Width = cell1.Width + cell2.Width;
- cell2.Width = 0;
- }
复制代码 |