int id = 1000;
private void btnInsertTable_Click(object sender, EventArgs e)
{
this.textControl1.Tables.Add(2, 3, id);
this.textControl1.Tables.GetItem(id).Select();
this.textControl1.TableFormatDialog();
id++;
}
非常感谢你,你这个方法是可以选择上自己了!现在又出现一个新的问题,用户设置完成后,光标怎么还在那个表格中的第一个表格中的,怎么能让光标如插入后自动停的位置?
执行this.textControl1.TableFormatDialog();这个后
怎么让光标自动到新创建表格的下一行?
int id = 1000;
private void btnInsertTable_Click(object sender, EventArgs e)
{
int rowcount, colcount,txtposition;
rowcount = 2;
colcount = 3;
txtposition = this.textControl1.InputPosition.TextPosition;
this.textControl1.Tables.Add(2, 3, id);
this.textControl1.Tables.GetItem(id++).Select();
this.textControl1.TableFormatDialog();
this.textControl1.Focus();
this.textControl1.InputPosition = new InputPosition(txtposition + rowcount * colcount + 1);
}
谢谢,这次好了! 思路就是设置InputPosition,你也可以根据你的需求来设置其具体位置。 哈正好我也在找 嘿嘿
回复 11# dof 的帖子
:~我的怎么报错了啊this.textControl1.TableFormatDialog();就是在这一句除了这几句代码 还要添加别的什么吗? 你可以将先注释掉,确定Table是不是被选中了。int id = 1000;
private void btnInsertTable_Click(object sender, EventArgs e)
{
this.textControl1.Tables.Add(2, 3, id);
this.textControl1.Tables.GetItem(id).Select();
//this.textControl1.TableFormatDialog();
id++;
} file:///E:/pig1.jpg这个确实是 有的呐:~ 晕 图片呢?