### ProgressBar Styles

Define an external CSS file, which is used for the classes defined.
B4J
CSS File CustomStyles.css located in the Files (=dirassets) folder
.red-progress-bar .bar {
-fx-background-color: red;
-fx-background-radius: 5;
}
.green-progress-bar .bar {
-fx-background-color: green;
-fx-background-radius: 10;
}
.blue-progress-bar .bar {
-fx-background-color: blue;
-fx-background-radius: 20;
}
B4J Code
`Sub Process_Globals
...
Private ProgressBar1 As ProgressBar
Private ProgressBar2 As ProgressBar
Private ProgressBar3 As ProgressBar
...
End Sub`
`Sub AppStart (Form1 As Form, Args() As String)
...
' Add the stylesheet
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "CustomStyles.css"))
' Add the styleclass
ProgressBar1.StyleClasses.Add("red-progress-bar")
ProgressBar2.StyleClasses.Add("green-progress-bar")
ProgressBar3.StyleClasses.Add("blue-progress-bar")
`

Changed: 2018-06-05 13:15, Category: CSS, File: T6C177M1290.htm, ID: 1290