I am trying to use ListBox.ColumnTypeAt to set a cell type but using the example from the documentation gives me ‘Type “Listbox” has no member named “CellTypes”’.
This is the code in question, “listBox” is a ListBox:
I added the row to make the ListBox had at least one row (in case that makes difference). I get the above error and I get the same result when I use .CellTypeAt(0,0).
I can assign a ColumnType of another column:
listBox.ColumnTypeAt(0) = listBox.ColumnTypeAt(1)
But I cannot add a number (instead of the enum CellTypes):
listBox.ColumnTypeAt(0) = 3
This gives me the error ‘There is more than one method with this name but this does not match any of the available signatures.’
How can I change the cell type of a cell (or ideally the cell types of an entire column)? What am I doing wrong?
Figured it out… XOJO does not differentiate between “ListBox” and “listBox” and hence confused the type and the instance and chose whichever one was least convenient for the task. I renamed listBox listBox1 and it worked.
I usually shorten the instance to lb as ListBox for simple cases like testing or inside methods with lb being passed into the method, and named ones like lbNames, lbAdresses, etc if I have more involved cases.
Some like to use list as ListBox but I find that confusing as for me a list is more like an array …