B4J Question TextArea in yellow with CSSutils

MarcRB

Active Member
Licensed User
Longtime User
Hello,

I think a very basic question.
I'm struggling with textarea black letters on yellow background. Just like a post-it memo.

First I tried a light yellow backcolor at designer properties.
But at runtime it is white.
1692817670462.png


Then I tried those two lines of code. Both did not result in a yellow textarea.

[CODE lang="b4x" title="StyleSheets Properties"]CSSUtils.SetBackgroundColor(txtMemo, fx.Colors.Rgb(255,242,204))
'or
CSSUtils.SetStyleProperty (txtMemo, "-fx-background-color", "yellow")[/CODE]




Please let me know how I can make it yellow.

Marc
 
Solution
Have you set the border width to 0 in the designer? Also Try adding -fx-focus-color:Transparent;-fx-faint-focus-color:Transparent or whatever colours you prefer to the Extra CSS field. Don't forget a semi colon in between each.

If you're going to do a lot if this fine editing, you'd probably be better adding a stylesheet.
It works here directly in the designer, are you changing any other attributes on the textarea, or using the SetColorAndBorder method on it anywhere that you've forgotten about?




1692820216195.png
1692820238165.png
 
Upvote 1
Works for me too
1692820705177.png

(Apologies for size of screen grab - 4k monitor has far too many pixels)
 
Upvote 0
Now that is strange, I tried it with your colour : #FFF4F488 and I just get a slight yellow hue around the edge.no colour in the middle.
 
Upvote 0
#FFF4F488 according to a web search is this colour
1692821444024.png
(it looks white'ish to me)
 
Upvote 0
Add it to the Extra CSS box in the designer with: -fx-control-inner-background:#F4F488; and it displays. How weird is that. Although it is targeting a different node I guess. So perhaps, there is your answer.
 
Upvote 0
Maybe is it because my textarea is on a pane and that pane is on a accordion. I did not try without accordion, yet.

Post#8 Was a solution for the color.
Thanks. I changed the color to FFF2CC because it was a little bit to yellow for me.

As you noticed in post #4, there is also a litte hue. (focus border)
See the images. I would like no border in the textarea.


No focus (grey border)
1692830529739.png



Has Focus
1692830631010.png



Wish no border / focus (this image is created by photoshop/paint)

1692830361163.png
 
Last edited:
Upvote 0
Have you set the border width to 0 in the designer? Also Try adding -fx-focus-color:Transparent;-fx-faint-focus-color:Transparent or whatever colours you prefer to the Extra CSS field. Don't forget a semi colon in between each.

If you're going to do a lot if this fine editing, you'd probably be better adding a stylesheet.
 
Upvote 0
Solution
In the designer the border width was set to 0

your extra css code worked for 'has focus' situation.
For no focus situation I added " -fx-border-color:#FFF2CC;"

[CODE lang="java" title="Extra CSS" highlight="4"]-fx-focus-color:Transparent;
-fx-faint-focus-color:Transparent;
-fx-control-inner-background:#FFF2CC;
-fx-border-color:#FFF2CC;[/CODE]

Result:
1692836988156.png


Thank you.
 
Upvote 0
Back
Top