如何在ScintillaNet控件中将光标移动到特定行中的特定位置?

如何在ScintillaNet控件中将光标移动到特定行中的特定位置?

问题描述:

我需要通过代码将光标移动到特定行的期望位置,任何可以使之起作用的想法都会受到赞赏.

I need to move the cursor to a desired position of a certain line by code, any ideas which could get that to work will be appreciated.

这是您要寻找的吗?

SCI_GOTOLINE(int行),此操作将删除所有选择,并将插入号设置在行号line的开头,并滚动视图(如果 使其可见.锚定位置与 当前位置.如果line在文档中的行之外(第一个 行是0),则行集是第一个或最后一个.

SCI_GOTOLINE(int line) This removes any selection and sets the caret at the start of line number line and scrolls the view (if needed) to make it visible. The anchor position is set the same as the current position. If line is outside the lines in the document (first line is 0), the line set is the first or last.

来自 http://www.scintilla.org/ScintillaDoc.html