I get the following in a 4 hours coding with Xojo session earlier today.
- The line below compiles…
LB.ColumnType(ColIdx) = LB.TypeEditable
And when changed to:
LB.ColumnType(ColIdx) = ListBox.TypeEditable
also compiles, but this is the standard way to do that
That Copy / Paste weirdness !
- While debugging the above troubles (Edit Cell), I found a bug (in my code):
LB.ListIndex = LB.ListCount
The above line make the ListBox loose the Focus (and does compiles fine).
Listcount is 1-based, so I added ‘-1’ to the end of the line and vogue la barque.
- In KeyDown event, key is case insensible.
If key ="a" Then
is enough. No need to do:
If key ="z" or Key = "Z" Then
Tip: I used those If blocks as shortcuts to navigate to the first and last Rows in a ListBox: a/z is faster than fn+left arrow or fn+right arrow.
In less than one hour, I falled into three well know development traps:
a. Error in an object reference,
b. The eternal problem with 0-based and 1-based,
c. Case sensitive or case insensitive.
And I do not explain how a nervous breakdown will comes near to me (19th).
LBN: The last one for this pre-breakfast session: I loose the top / bottom arrow default use in the ListBox. I had to add code in the ListBox KeyDown event On the other hand, I added a direct jump to the first / last Row when the currently selectedr Row is the first or the last Row and I press the top or bottom key.