You cannot strictly limit the number of items allowed in a listbox (at
least that I know of), however there are workarounds. If you are
inserting items into the listbox programmatically, then obviously you
can limit the number of items written to it. If the user is
entering items, then after your maximum limit, set the "allow editing
cells" property to false, and optionally display some message saying
"only x number of items allowed at once".
You can access any element by setting it as the active row
(property->active row), then following declaring it as the active
row, you are able to change/read the value, and do whatever you like to
that row.
Also, you may want to use the "edit row" property to check which row is
currently active, depending on how you're planning on programming
this/what your needs are.