只要向表格的中间插入行或列(新产生的行不要出现在第一行或最后一行,第一列或最后一列)
- private void Form2_Load(object sender, EventArgs e)
- {
- this.textControl1.Tables.Add(10, 10, 11);
- TXTextControl.Table table = this.textControl1.Tables.GetItem(11);
- int i = 1;
- foreach (TXTextControl.TableCell cell in table.Cells)
- {
- cell.Name = "Cell" + i;
- cell.Text = cell.Name;
- i++;
- }
- }
- private void 显示NameToolStripMenuItem_Click(object sender, EventArgs e)
- {
- TXTextControl.Table table = this.textControl1.Tables.GetItem(11);
- foreach (TXTextControl.TableCell cell in table.Cells)
- {
- cell.Text = cell.Name;
- }
- }
- private void 上面ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- TXTextControl.Table table = this.textControl1.Tables.GetItem(11);
- table.Rows.Add(TXTextControl.TableAddPosition.Before, 1);
- }
- private void 下面ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- TXTextControl.Table table = this.textControl1.Tables.GetItem(11);
- table.Rows.Add(TXTextControl.TableAddPosition.Before, 1);
- }
复制代码 |