Background colours in TextEditor

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
pusherman
Posts: 16
Joined: Sunday 5th November 2023 11:45am

Background colours in TextEditor

Post 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
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Background colours in TextEditor

Post 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;
If at first you don't succeed , try doing something differently.
BruceS
pusherman
Posts: 16
Joined: Sunday 5th November 2023 11:45am

Re: Background colours in TextEditor

Post by pusherman »

Thank you!
User avatar
BruceSteers
Posts: 1585
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Background colours in TextEditor

Post 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 2302 times
Have fun :)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply