jacobslusser / ScintillaNET

A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
MIT License
964 stars 242 forks source link

Change background colour of LineNumber column #513

Closed Dinoosawruss closed 3 years ago

Dinoosawruss commented 3 years ago

Hi,

I am trying to change the background colour of the LineNumber column in the below Scintilla but have so far been unsuccessful image

Any assistance would be appreciated

VPKSoft commented 3 years ago

This doesn't seem to be possible if I read the Scintilla.org instructions correctly; the margin changes into a symbol margin:

scintilla.Margins[0].Type = MarginType.Color;
scintilla.Margins[0].BackColor = Color.OrangeRed;

image

But I'm not sure with such a short test 🙄

VPKSoft commented 3 years ago

Seemingly I was wrong: This works:

scintilla.Styles[Style.LineNumber].BackColor = Color.OrangeRed;
scintilla.Styles[Style.LineNumber].ForeColor = Color.BlueViolet;

image

Dinoosawruss commented 3 years ago

@VPKSoft hmm I tried what you did and it didn't work? I'll test it again and see

EDIT: Somehow it appears to now work, thanks for the help