【问题标题】:How to move the cursor to a specific position in a specific line in ScintillaNet control?如何将光标移动到 ScintillaNet 控件中特定行的特定位置?
【发布时间】:2012-05-20 16:33:49
【问题描述】:

我需要通过代码将光标移动到某一行的所需位置,任何可以使其工作的想法将不胜感激。

【问题讨论】:

    标签: c# .net scintilla


    【解决方案1】:

    这是你要找的吗?

    SCI_GOTOLINE(int line) 这将删除任何选择并将插入符号设置在行号行的开头并滚动视图(如果 需要)使其可见。锚点位置设置与 当前位置。如果行在文档中的行之外(首先 line 为 0), line set 是第一个或最后一个。

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

    【讨论】:

    • 实际上我可以通过这种方式完成它:scintilla1.GoTo.Line(2); int nowPosition = scintilla1.Caret.Position; int wantedPosition = nowPosition + 3; scintilla1.GoTo.Position(wantedPosition); scintilla1.Focus(); 谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 2013-05-25
    • 2021-08-24
    • 1970-01-01
    相关资源
    最近更新 更多