Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个代码片段来删除 ScintillaNET 控件的最后一行并向其附加一行。我试过这个但没有奏效:
scintilla1.GoTo.Line(scintilla1.Lines.Count); int nowPosition = scintilla1.Caret.Position; scintilla1.Text.Remove(nowPosition);
抱歉迟到了。我找到了这篇文章,很遗憾没有看到任何好的东西(不是你的错),所以我一直在环顾四周,发现了这个:
((INativeScintilla)scintilla).DeleteBack()
这将模拟退格键按下(删除光标左侧的 1 个字符)。它不漂亮,但它可以为你完成工作。为我工作:)
对您来说,您可以将光标位置存储在一个 int 中,将其设置到末尾,“退格”您想要的所有字符,然后将其设置回来。