标签: scintillanet

如何防止 ScintillaNET 控件自动滚动?

我在我的 C# Winforms 应用程序中使用 ScintillaNET 控件。我正在尝试实现一个自动标记功能,该功能将在之前自动完成标记,例如,当用户键入时<html>,自动完成功能将触发并插入</html>

我正在CharAdded为此实现使用 ScintillaNET函数:

if (caretPos != 0)
        {
            //If the characters before the caret are "ml>" (last three chars from "<html>")
            if (TextArea.Text[caretPos - 1] == '>' && TextArea.Text[caretPos - 2] == 'l' && TextArea.Text[caretPos - 3] == 'm')
            {
                TextArea.Text = TextArea.Text.Insert(caretPos, "</html>");
                TextArea.SelectionStart = caretPos + 0;
                TextArea.Selections.First();
                TextArea.ScrollCaret();
            }
        }
Run Code Online (Sandbox Code Playgroud)

问题

我的问题是,Scintilla 控件一直向上或向下滚动。我认为该ScrollCaret()功能会起作用,但它一直在发生。有任何想法吗?

.net c# winforms scintillanet

7
推荐指数
1
解决办法
186
查看次数

ScintillaNET没有显示方法块的折叠

我正在使用ScinctillaNET编辑器,我遇到的问题是它没有显示"[+]"和方法的"[ - ]折叠符号,至少对于Vb.Net词法分析器如图所示:

(注意第632行中缺少的符号) 在此输入图像描述

我不确定这是作者在包装器中的设计问题,还是我的错,这是我用Vb.Net编写的样式:

Public Shared Sub SetVbNetStyle(ByVal editor As Scintilla)

    Dim keywords As String =
        "#const #debug #else #elseif #end #if #release " & _
        "addhandler addressof aggregate alias and andalso ansi as assembly auto " & _
        "binary boolean byref byte byval " & _
        "call case catch cbool cbyte cchar cdate cdbl cdec char cint class clng cobj compare const continue csbyte cshort csng cstr ctype cuint culng …
Run Code Online (Sandbox Code Playgroud)

c# vb.net user-controls folding scintillanet

5
推荐指数
1
解决办法
594
查看次数

标签 统计

c# ×2

scintillanet ×2

.net ×1

folding ×1

user-controls ×1

vb.net ×1

winforms ×1