问题
How do I set and remove color for the find text in a scintilla document by writing plugins for notepad++ in c#. I tried the following code:
Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_STYLESETBACK, 0, 0xFFFF00);
Help me to highlight a particular text.
回答1:
If you want to change the selection background color, then try:
Win32.SendMessage(PluginBase.GetCurrentScintilla(),
SciMsg.SCI_SETSELBACK, 1, 0xFFFF00);
If you want to change the selection foreground color, then try:
Win32.SendMessage(PluginBase.GetCurrentScintilla(),
SciMsg.SCI_SETSELFORE, 1, 0xFF0000);
To reset the default color, pass 0
instead of 1
.
来源:https://stackoverflow.com/questions/21478948/notepad-plugin-find-and-highlight-text