I hate to ask such a seemingly simple question, especially when I’ve done what I’m trying to do in the past without problem. But I have a ListBox with 6 columns, and I’m trying to populate each column with data. As best as I can tell from the Docs, to populate the first column, I should be using “CellTagAt,” with a loop. For instance:
For i as Integer = myArray.FirstIndex to myArray.LastIndex
ListBox1.CellTagAt(0, i) = myArray(i)
Next
But I’m getting an OutOfBounds Exception. I know a lot has changed in Xojo since I last did this but I can’t seem to find the correct way to do it now. Any help would be greatly appreciated. Thanks!
You can also populate new rows faster by putting everything on one line.
Instead of:
MyListbox.AddRow " "
MyListbox.Cell(MyListbox.LastIndex, 0) = w
MyListbox.Cell(MyListbox.LastIndex, 1) = x
MyListbox.Cell(MyListbox.LastIndex, 2) = y
MyListbox.Cell(MyListbox.LastIndex, 3) = z
You can do it like:
MyListbox.AddRow w, x, y, z
That does not work for MyListbox.AddRowAt however.