Wish UI

derez

Expert
Licensed User
Longtime User
Is it possible to give examples of using the UI ? I find many actions impossible (like color a label's background) .
 

stevel05

Expert
Licensed User
Longtime User
This thread may help you, uses a style sheet attached to the scene builder.
 

derez

Expert
Licensed User
Longtime User
Your example looks very nice but I still don't know how to put in the right style for coloring the background.
I found in css analyser "-fx-background-fills" but get all kind of errors when try to add the color.
 

stevel05

Expert
Licensed User
Longtime User
I think setting background colour is
B4X:
-fx-background-colour : Red;
but I'm not at my computer at the moment. You can put it in the one shot stylefield if that's all you want to do with that Node, or give the Anchorpane or other object an ID or class and add it to a stylesheet.
 

derez

Expert
Licensed User
Longtime User
Thanks, I'll try it.
Erel is correct "-fx-background-color: "
How do I change while running by code ?
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
You could use MainForm.Backcolor, or for a Pane you can set the style in code : Pane.Style

you can add multiple styles to the style attribute,

B4X:
Label1.Style="-fx-background-color : yellow; -fx-text-fill :Green;"

each time it will replace what was there before and apply the new style, and will take precedent over a style sheet definition.
 
Top