问题搞定了。
把InputPosition调整到最后面就可以了。就加这一句:
textControl1.InputPosition = new TXTextControl.InputPosition(textControl1.Selection.Start,
TXTextControl.TextFieldPosition.OutsideTextField);
- int length = textControl1.Text.Length;
- textControl1.Select(length, 0);
- textControl1.InputPosition = new TXTextControl.InputPosition(textControl1.Selection.Start,
- TXTextControl.TextFieldPosition.OutsideTextField);
- if (FilePath.Contains(".tx"))
- {
- textControl1.Selection.Load(FilePath, TXTextControl.StreamType.InternalFormat);
- }
- else
- {
- textControl1.Selection.Load(FilePath, TXTextControl.StreamType.MSWord);
- }
复制代码 |