Wish Button text will change its color if disabled

ranul

Member
Licensed User
Longtime User
Hi,

I wish that when I disabled a button (btn.Enabled = False), the button text will change its color to the standard disabled color.
It does work that way with ComboBox text.

Thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the default behavior of buttons with the default JavaFX theme.

It is quite simple to change it.
Add a file named style.css to the Files tab with this content:
B4X:
.button:disabled, .button:default:disabled {
    -fx-text-fill: gray;
}

Load it with:
B4X:
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "style.css"))
 
Top