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
Background colours in TextEditor
- BruceSteers
- Posts: 1790
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Background colours in TextEditor
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....
There are many things you can set and you can get a list of available styles like this..
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;
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
BruceS
Re: Background colours in TextEditor
Thank you!
- BruceSteers
- Posts: 1790
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Background colours in TextEditor
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. Have fun
If at first you don't succeed , try doing something differently.
BruceS
BruceS