### Set all Buttons Style Transparent

Set all buttons CSS style to transparent by using the CSSUtils Library.
Select CSSUtils in the B4J IDE Library Manager.
Option SetBackgroundColor [preferred]
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If n Is Button Then CSSUtils.SetBackgroundColor(n, fx.Colors.Transparent)
Next
Option SetStyleProperty
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If n Is Button Then CSSUtils.SetStyleProperty(n, "-fx-background-color", "transparent")
Next
Sub Examples
' Set button style to transparent for all buttons
`Sub SetButtonsStyleTransparent 'ignore
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If n Is Button Then CSSUtils.SetBackgroundColor(n, fx.Colors.Transparent)
Next
End Sub`
' Set button style to transparent for buttons matching given tag
`Sub SetButtonsStyleTransparentByTag(Tag As String) 'ignore
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If (n Is Button) And (n.Tag = Tag) Then
CSSUtils.SetBackgroundColor(n, fx.Colors.Transparent)
End If
Next
End Sub`

Changed: 2018-04-21 15:22, Category: Buttons, File: T6C167M1233.htm, ID: 1233