I have some initial values set for a ListBox in the IDE. Of course I do not want them in my running app. But I can reliably crash the listbox by simple doing the following in its Open event:
Sub Open() Handles Open
me.InitialValue = ""
Me.CellType(0, 1) = Listbox.TypeEditableTextField // <- OutOfBoundsException
End Sub
But adding a simple space is enough to prevent the error:
Sub Open() Handles Open
me.InitialValue = " "
Me.CellType(0, 1) = Listbox.TypeEditableTextField // <- No more OutOfBoundsException
End Sub
Any idea why?