【问题标题】:Notepad++ plugin - find and highlight textNotepad++ 插件 - 查找并突出显示文本
【发布时间】:2014-01-31 11:26:08
【问题描述】:

如何通过在 c# 中编写 notepad++ 插件来为闪烁文档中的查找文本设置和删除颜色。我尝试了以下代码:

Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_STYLESETBACK, 0, 0xFFFF00);

帮助我突出显示特定文本。

【问题讨论】:

    标签: c# plugins notepad++ scintilla


    【解决方案1】:

    如果你想改selection background color,那么试试:

    Win32.SendMessage(PluginBase.GetCurrentScintilla(),
                      SciMsg.SCI_SETSELBACK, 1, 0xFFFF00);
    

    如果你想改selection foreground color,那么试试:

    Win32.SendMessage(PluginBase.GetCurrentScintilla(),
                      SciMsg.SCI_SETSELFORE, 1, 0xFF0000);
    

    要重置默认颜色,请传递 0 而不是 1

    【讨论】:

      猜你喜欢
      • 2019-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-15
      • 2012-09-30
      • 1970-01-01
      • 1970-01-01
      • 2019-03-15
      相关资源
      最近更新 更多