Changing Selected Row of Weblistbox at Runtime

Hello,

I am new to Xojo. I had created a weblistbox. I would like to change the color of the active selected row at runtime. Therefore I am thinking of applying Styles to the webListBox but it seems like ignoring my assignment.

I had placed the codes in the WebListBox1.CellClick events
If Row = 1 Then
Me.SelectionStyle = StyleBlueSelection
Else
Me.SelectionStyle = StyleRedSelection
End

If changing of Style is not possible, may I know what is the function to change the color of selected row at runtime? I had googled the web but still could not find a valid answer.

Thank you in advance.

Regards,
Alvin

Unfortunately, it seems changing the selection style is only possible in the Open event.

Since the selected class (selection color) is buried deep in the framework external file, changing that with JavaScript is off limit.

You may want to change the color of the text instead.