### Set CSS Style

Example using an external CSS file.
Create the file project.css in the dirassets (=files) folder. This example contains several style settings.
.tree-view, .tree-cell {
-fx-background-color:#ff0000;
-fx-text-fill:#ffffff ;
}
.tree-cell:expanded, .tree-cell:sub-tree-item {
-fx-background-color: #404040 ;
}
.tree-cell:selected {
-fx-font-weight: bold ;
}
.tree-cell {
-fx-padding: 0.75em 0em 0.75em 0em ;
}
.tree-cell:sub-tree-item {
-fx-padding: 0.25em ;
}
Add the file project.css to the files in the B4J IDE Files Manager.
Add the Stylesheet to the MainForm in AppStart:
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "project.css"))

Changed: , Category: TreeView, File: T6C272M2026.htm, ID: 2026