【发布时间】:2015-07-19 12:40:08
【问题描述】:
设置了 SelectionStart 和 SelectionLength 后,插入符号位于选择的末尾。
如何将插入符号移到所选内容的开头?
我现在尝试了这个:其他线程没有回答这个问题
SelectionStart = selStart; // set the desired position
SelectionLength = 0;
MyLibs.WindowsDll.POINT point;
MyLibs.WindowsDll.GetCaretPos(out point); // save the position
SelectionLength = restOfWord.Length; // extend the selection
MyLibs.WindowsDll.SetCaretPos(point.X, point.Y); // restore caret position
GetCaretPos 和 SetCaretPos 以某种方式工作,但不是应该的。 使用上面的代码 sn -p,插入符号确实在选择的开头闪烁。
但是...然后我按退格键或向左/向右光标,插入符号的行为仍然像它仍在选择的末尾一样。
【问题讨论】: