### CSS Styling

Various examples to set the CSS Styling of a SplitPane.
Note:
Requires the JavaObject library and the methods must be called after the form is loaded, because the API method lookup is used.
Private splitMain As SplitPane
Set Divider Width
Dim joSplitPane As JavaObject = splitMain
Dim joSplitPaneDivider As JavaObject = joSplitPane.RunMethod("lookup", Array(".split-pane-divider"))
If Not(joSplitPaneDivider=Null) Then
CSSUtils.SetStyleProperty(joSplitPaneDivider, "-fx-padding", "0.05em;")
' If more dividers use like:
' CSSUtils.SetStyleProperty(joSplitPaneDivider, "-fx-padding", "0 0.75em 0 0.75em;")
End If
Remove Border
Dim joSplitPane As JavaObject = splitMain
Dim joSplitPaneDivider As JavaObject = joSplitPane.RunMethod("lookup", Array(".split-pane-divider"))
If Not(joSplitPaneDivider=Null) Then
CSSUtils.SetStyleProperty(joSplitPaneDivider, "-fx-box-border", "transparent;")
End If
Change Divider Color
Dim joSplitPane As JavaObject = splitMain
'Option 1
joSplitPane.RunMethodJO("lookup", Array(".split-pane-divider")).RunMethod("setStyle", Array("-fx-background-color: RED;"))
'Option 2
Dim joSplitPaneDivider As JavaObject = joSplitPane.RunMethod("lookup", Array(".split-pane-divider"))
If Not(joSplitPaneDivider=Null) Then
CSSUtils.SetStyleProperty(joSplitPaneDivider, "-fx-background-color", CSSUtils.ColorToHex(fx.Colors.Red))
End If

Changed: 2018-04-01 11:37, Category: SplitPane, File: T6C253M2156.htm, ID: 2156