Skip to content

Instantly share code, notes, and snippets.

@jcouture100
Created July 10, 2024 21:53
Show Gist options
  • Save jcouture100/b45c089aeee9e0da171c5a91208854b1 to your computer and use it in GitHub Desktop.
Save jcouture100/b45c089aeee9e0da171c5a91208854b1 to your computer and use it in GitHub Desktop.
ScintillaNET Json Recipe
private static void SetStyleJson(Scintilla scintilla)
{
// Reset the styles
scintilla.StyleResetDefault();
// Use fixed font for Json
scintilla.Styles[Style.Default].Font = "Consolas";
scintilla.Styles[Style.Default].Size = 11;
scintilla.StyleClearAll();
// Add color styles
scintilla.Styles[Style.Json.Number].ForeColor = Color.Red;
scintilla.Styles[Style.Json.String].ForeColor = Color.Purple;
scintilla.Styles[Style.Json.PropertyName].ForeColor = Color.FromArgb(0, 102, 204); // Blue/Gray
scintilla.Styles[Style.Json.Keyword].ForeColor = Color.Blue;
// Add key words
scintilla.SetKeywords(0, @"null");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment