### Set Item Hover Style

To hightlight the selected Listview Item when hovering over, define an external stylesheet and add the file to the MainForm.
Example:
Create the Stylesheet
This is the content of the stylesheet listview.css stored in the Project Files folder.
/*Change the color of a selected cell*/
.list-cell:hover {
-fx-background-color: red;
-fx-text-fill: white;
}
Add the Stylesheet listview.css to the B4J IDE Files Manager.
The listview.css file must be added to the project files list via the B4J IDE Files Manager.
Add the Stylesheet to the form (in this example the MainForm)
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "listview.css"))
B4J Full Code Example
`Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private lv As ListView
End Sub`
`Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
lv.Initialize("lv")
For i = 1 To 100
lv.Items.Add(i)
Next
lv.SelectedIndex = 0
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "listview.css"))
MainForm.RootPane.AddNode(lv, 0, 0, -1, -1)
End Sub`

Changed: , Category: ListView, File: T6C216M1594.htm, ID: 1594