Page 1 of 1

Background colours in TextEditor

Posted: Saturday 13th April 2024 11:16am
by pusherman
Hi all,

I'm using a TextEditor control but I'm having difficulty in working out how to set the background colour.

I've looked through the online documentation where it talks about styles and themes but, unless I'm missing something, I can't find anything to answer my question.

I'm looking for the equivalent of : TextArea1.Background = <colour>
but for TextEditor

Thanks
Pusherman

Re: Background colours in TextEditor

Posted: Saturday 13th April 2024 11:52am
by BruceSteers
The TextEditor uses a TextHighlighterTheme that overrides basic Control properties like Background/Foreground.

https://gambaswiki.org/wiki/comp/gb.for ... itor/theme

https://gambaswiki.org/wiki/comp/gb.hig ... ghtertheme

Change the Background like this....


  TextEditor1.Theme["Background"].Color = Color.Cyan


There are many things you can set and you can get a list of available styles like this..
For Each s As TextHighlighterStyle In TextEditor1.Theme.Styles
  Print s.Key; "; ";
Next


Normal; Background; Selection; Current; Breakpoint; Highlight; Added; Removed; Error; Comment; Documentation; Keyword; Function; Operator; Symbol; Number; String; Datatype; Preprocessor; Escape; Constant; Shebang; Expansion; Command; AtRule; Class; PseudoClass; Id; Tag; TagAttribute; Color; Unit; Important; Diff; Index; File; Position; Doctype; Entity; Markup; Attribute; Value; RegExp; Label;

Re: Background colours in TextEditor

Posted: Saturday 13th April 2024 1:19pm
by pusherman
Thank you!

Re: Background colours in TextEditor

Posted: Saturday 13th April 2024 2:21pm
by BruceSteers
pusherman wrote: Saturday 13th April 2024 1:19pmThank you!
You're welcome.

You'll see you can set Color , Bold, and many other properties for certain types of text that will show when a TextEditor.Highlight mode like "gambas" or "sh" is used.

And that's pretty cool.
I have it my ScripEd text editor I can fully customize every style in the theme of every highlight mode.
Untitled.jpg
Untitled.jpg (87.27 KiB) Viewed 2647 times
Have fun :)