Background colours in TextEditor

Post

Posted
Rating:
#1 (In Topic #1224)
Trainee
 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
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
The TextEditor uses a TextHighlighterTheme that overrides basic Control properties like Background/Foreground.

/comp/gb.form.editor/texteditor/theme - Gambas Documentation

/comp/gb.highlight/texthighlightertheme - Gambas Documentation

Change the Background like this….

Code (gambas)

  1.  
  2.   TextEditor1.Theme["Background"].Color = Color.Cyan
  3.  

There are many things you can set and you can get a list of available styles like this..

Code (gambas)

  1. For Each s As TextHighlighterStyle In TextEditor1.Theme.Styles
  2.   Print s.Key; "; ";
  3.  

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;
Online now: No Back to the top

Post

Posted
Rating:
#3
Trainee
Thank you!
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’

pusherman said

Thank 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.
Image

(Click to enlarge)


Have fun :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.