What is the real use of ListBox.SelectedRowValue?

Apparently, and according to the documentation, ListBox.SelectedRowValue returns only Column(0) of the first selected Row (IMHO)… (read below)

Absolutely useless in my case (I wanted to store the selection into a variable.

Someone knows ListBox.SelectedRowValue usage in real coding life?

Documentation:
SelectedRowValue As String

The value of the currently selected item.

In the case of multi-column ListBoxes, the value of the cell in the first column is returned.


To achieve the beginning of my feature, I have to read each Row from Row(0) and store the Selected Row(s) each time I encounter one…

Then what’s the problem with just not using it?

That’s a shortcut for Listbox.CellTextAt(Row,0). I guess beginners are more comfortable with this :man_shrugging:.

If you’re converting a real menu to one implemented using a one-column listbox? Which may be necessary on the Pi if your menu is very tall. I had to do that already as a Pi menu that is too tall for the screen doesn’t seem to scroll.

dim variable As string =ListBox.SelectedRowValue :man_facepalming:t2:

It has always been this way, although the name was different in API 1. It’s a convenience method for people interacting with a single-column listbox. If you don’t need it, just ignore it.

3 Likes