B4J Question How to change TextArea background color with CSSUtils?

ThRuST

Well-Known Member
Licensed User
Longtime User
Like the headline reads How to change TextArea background color with CSSUtils?

The following code only sets the color for the border (I'm using Color picker dialog)

And "fx-background" has no effect. CSSUtils.SetBackGroundColor.. is the same as below.

B4X:
CSSUtils.SetStyleProperty(TextArea1,"-fx-background-color", CSSUtils.ColorToHex(Value))

How to do this?
 
Last edited:

ThRuST

Well-Known Member
Licensed User
Longtime User
This is what it looks like. I am using a TextArea in a TabPane. Document tab=HTMLeditor / Code Tab=TextArea)
I use a CSS file for the design were I also set textarea properties. Might be that?



Code
B4X:
Sub ColorPickerBgr_ValueChanged (Value As Paint)

    Log (Value)
    CSSUtils.SetBackgroundColor(TextAreaCode, fx.Colors.Red)
 
End Sub

CSS
 
Last edited:
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
I removed the -fx-background-color in .text-area .context but the problem is still the same. I was hoping CSSUtils would override the CSS settings and in Internal Designer (yes I am only using it since it's better than Scene Builder mostly because of the scaling script which is extremely useful)
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Yes I will do that. Also as a way to debug it to build it step by step that should be helpful. Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…