【问题标题】:Custom highlight with ScintillaNET使用 ScintillaNET 自定义高亮
【发布时间】:2012-05-30 15:27:41
【问题描述】:

在我的 winforms 应用程序中,我会创建一个自定义语法高亮,所以我制作了这个 xml:

<ScintillaNET>
  <Language Name="default">
    <Styles>
      <Style Name="Default" FontName="Consolas"/>
    </Styles>
  </Language>

  <Language Name="customSql">
    <Lexer LineCommentPrefix="--" StreamCommentPrefix="/* " StreamCommentSuffix=" /*" LexerName="customSql" >
      <Keywords List="0">
        Data Source Initial Catalog User Id Password Database Server Trusted_Connection
        Integrated Security Network Library User Instance AttachDbFilename Failover Partner
        Asynchronous Processing Uid Pwd Provider SSPI
      </Keywords>
    </Lexer>

    <Styles>
      <Sytle Name="CHARACTER" ForeColor="Black"/>
      <Sytle Name="NUMBER" ForeColor="Red" />
    </Styles>
  </Language>
</ScintillaNET>

对我来说看起来不错。在我的应用程序中,我将语言和其他属性设置为:

myC.ConfigurationManager.Language = "customSql";
myC.ConfigurationManager.CustomLocation = Global.Path + @"Resources\ScintillaNET.xml";
myC.ConfigurationManager.Configure();

我不明白为什么这仍然不起作用。我也不例外,只是文字保持黑色。有什么提示吗?

【问题讨论】:

    标签: c# xml winforms syntax-highlighting scintilla


    【解决方案1】:

    可能是因为您将 ForeColor 设置为 Black,但从未将 BackColor 设置为黑色以外的其他颜色?

    【讨论】:

    • 嗨,我也删除了该节点,但没有任何反应。我可以尝试重新编译 ScintillaNET,包括我的自定义 xml,但我也认为这应该是一种更简单的方法
    猜你喜欢
    • 2011-10-31
    • 2011-12-10
    • 2016-12-30
    • 2011-08-06
    • 2011-09-03
    • 1970-01-01
    • 1970-01-01
    • 2021-09-27
    • 2012-02-21
    相关资源
    最近更新 更多