Setting background colour of the Line Number margin

29 views
Skip to first unread message

Andrew Truckle

unread,
Apr 24, 2024, 6:02:57 PMApr 24
to scintilla-interest
I am using the HTML lexer at the moment to display XML files.

My application is Visual C++ MFC based so it does not support dark mode or anything.

The line numbers margin is visible, but how do I change the background colour to be subtly different to what it is now? At the moment it is the same as my dialog background, where the control resides.

I am using the CScintillaCtrl wrapper.

Thank you.

Neil Hodgson

unread,
Apr 24, 2024, 6:25:14 PMApr 24
to scintilla-interest
AJ:

The line numbers margin is visible, but how do I change the background colour to be subtly different to what it is now? At the moment it is the same as my dialog background, where the control resides.

STYLE_LINENUMBER

Neil

Andrew Truckle

unread,
Apr 25, 2024, 4:10:44 AMApr 25
to scintilla-interest
Thanks.  I can't seem to find the equivalent in the CScintillaCtrl wrapper. I tried:

m_edit.SetMarginBackN(0, RGB(0, 255, 0));

Andrew Truckle

unread,
Apr 25, 2024, 6:19:49 AMApr 25
to scintilla-interest
I had a look at the Scintilla sources again, so I am now trying this:

SetAStyle(static_cast<int>(Scintilla::StylesCommon::LineNumber), RGB(0, 0, 0), RGB(211, 211, 211));

But it still does not work.

Andrew Truckle

unread,
Apr 25, 2024, 6:21:31 AMApr 25
to scintilla-interest
My fault. I was calling StyleClearAll which was resetting it.

Kevin Wang

unread,
Apr 25, 2024, 11:56:01 AMApr 25
to scintilla...@googlegroups.com, truc...@gmail.com
Andrew,

Please forget MFC. I always use WTL to develop any Win32 application.

Trust me.

Kevin

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-inter...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/a0ac6acc-7f1a-492f-b144-844ea010329cn%40googlegroups.com.

Andrew Truckle

unread,
Apr 25, 2024, 12:04:37 PMApr 25
to scintilla-interest
Kevin, this is a 20 year old project. MFC isn't going anywhere from it. Although I use more std stuff.
Reply all
Reply to author
Forward
0 new messages