B4J Question Manage background of disabled textField

rossati

Active Member
Licensed User
Longtime User
Hello

I am not able to manage the background of disabled text Field; the best I've managed to get is adding to a css asset file this (copied from pastebin.com):
.text-field:disabled {
-fx-opacity: -fx-disabled-opacity;
}
this works (partially) but in the log I have this error:
Where i can found a documentation, and samples?

Thanks

Giovanni Rossati
 

rossati

Active Member
Licensed User
Longtime User
Thanks

I know the JavaFx reference guide bat because I am not yet very trained on it i am not able for example to to aligne a label using:
-fx-text-alignment: right;

Giovanni Rossati
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
For changing styles, the recommendation is to use the CSSUtils Library.

Example related to your questions
B4X:
Private TextField2 As TextField

TextField2.Text = "This textfield is not enabled"
TextField2.Enabled = False

CSSUtils.SetBackgroundColor(TextField2, fx.Colors.ARGB(100,255,0,0))
CSSUtils.SetStyleProperty(TextField2, "-fx-alignment", "center-right")

 
Upvote 0

rossati

Active Member
Licensed User
Longtime User
Thanks

The background color of a not enabled TextField is darked; I used a not editable TextField for see a desired color.
Since I was not able to align a text on label to right, I used a non-editable TextField.
Giovanni Rossati
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…