xiaoyaox044 发表于 2012-2-18 16:11:00

textControl1.Text.Insert(,)没效果?

比如想在文本框中插入一段字符串:
textControl1.Text.Insert(10, "asdf");
为什么没效果呢?请版主帮忙~

ZenosZeng 发表于 2012-2-20 10:17:00

回复 1# xiaoyaox044 的帖子

Insert()是string类型的方法,通过Text.Insert()暂时无法直接插入字符,如果需要进行插入字符操作,可以使用下面的代码:
    this.textControl1.Selection.Start = 10;
    this.textControl1.Selection.Length = 0;
    this.textControl1.Selection.Text = ",";

xiaoyaox044 发表于 2012-2-20 17:00:00

OK,感谢斑竹

ZenosZeng 发表于 2012-2-20 18:14:00

不客气 :)
页: [1]
查看完整版本: textControl1.Text.Insert(,)没效果?