How to keep selected web listsbox rows, the selected background color/style?

Hello all,

I am trying to mark one or more weblistbox rows as selected. One is easy, but when another row is selected, the color changes.

I wrote code in the SelectionChange event to try to keep that background, but it doesn’t work. Ideas would be appreciated!

  For n As Integer = 0 to indexAlmLst.Ubound -1
    For i as Integer = 0 to me.ColumnCount -1
      me.CellStyle(n,i) = styleListBoxRowSelected
      Me.RefreshCell(n, i)
    Next i
  Next n


Weblistboxes are really great for displaying lists of data, but no where near the functionality of the desktop listbox. We must remember that the desktop listbox is not a native control, but one that Xojo has put a lot of time & investment into.

I roll my own list box using a container with many embedded containers (rows) and of course scroll bars. This also allows me to specify each column as a Label, Textfield, Popup Menu, Checkbox etc. This has the advantage of the GUI only having displayed data which improves performance - although there is a hit initially adding each row.

Selecting multiple rows becomes easy in this situation, you just set the style for the row container.