### Set Tooltip Style

Example of changing the tooltip style of a button using API methods (Requires the JavaObject library).
Usage
Button_SetToolTipStyle(Button1, "-fx-font-size:20;-fx-background-color: linear-gradient(#FFFFFF, #DEDEDE); -fx-text-fill: orange;")
Button_SetToolTipStyle(Button2, "-fx-font-size:20;-fx-text-fill: yellow;")
Subroutine
`Private Sub Button_SetToolTipStyle(Btn As Button, Style As String)
Dim joButton As JavaObject = Btn
Dim ToolTipText As String = Btn.TooltipText
Dim joToolTip As JavaObject
joToolTip.InitializeNewInstance("javafx.scene.control.Tooltip", Array(ToolTipText))
joToolTip.RunMethod("setStyle", Array(Style))
joButton.RunMethod("setTooltip", Array(joToolTip))
End Sub`
Advanced Example
Set the tooltip style for buttons in a form, if the button tag is 1.
`Private Sub Form_SetButtonsTooltipStyle(frm As Form)
For Each n As Node In frm.RootPane.GetAllViewsRecursive
If n Is Button And n.Tag = "1" Then
Button_SetToolTipStyle(n, "-fx-font-size:20;-fx-background-color: linear-gradient(#FFFFFF, #DEDEDE); -fx-text-fill: black;")
End If
Next
End Sub`

Changed: 2018-05-01 17:32, Category: Buttons, File: T6C167M2168.htm, ID: 2168