B4J Question CSS File Not Working.

XbNnX_507

Active Member
Licensed User
Longtime User
Hi All,

I have a little issue here.
In Extra CSS Property of TextField in the Designer this code works fine:
Code: Copy
-fx-border-width: 0 0 2 0;
-fx-border-color: red;
-fx-background-color: transparent;

When i put the above code in a css file and add it to MainForm.StyleSheets.add("mycss.css")
it just don't work. Why?

mycss.css is file is like this:
Code: Copy
.text-field {
-fx-border-width: 0 0 2 0;
-fx-border-color: red;
-fx-background-color: transparent;
-fx-text-fill: red;    '<- this is the only thing that takes effect
}
 
If you are setting all of the properties in the css file, you can just clear the Style property:

B4X: Copy
TextField1.Style = ""
And the css will work.
I've been looking for this information for over a week now!!!!
 
Upvote 0
Back
Top