Listbox DefaultRowHeight vs RowHeight?

Listbox DefaultRowHeight

Gets the ListBox row height. All rows in a ListBox are always the same height, which you can change using DefaultRowHeight.

Shouldn’t DefaultRowHeight be read only (the one you can’t change), and RowHeight be changable?

Where is the logic in THAT???

The way I understand it.

  • DefaultRowHeight is where you specify what height you want, it allows a wildcard of -1, where the ListBox will use whatever it thinks is good.
  • rowHeight tells you the actual height of the row(s)

If that would be the case with DefaultRowHeight being read only and (actual) RowHeight variable then I’d agree - but it is the other way round. Nonsensical.

I would agree with you, Markus, if we were able to specify a RowHeight for individual rows. Without that capability, RowHeight really has no meaning other than fewer letters than DefaultRowHeight. Ideally, IMO, both should be changeable with RowHeight taking the row as a parameter and applying to just that row.

until they rewrite listbox we’re unlikely to get individual row heights

Default RowHeight and RowHeight do behave as a weird pair BUT

  • default row height can be read AND written
    it will return -1 if thats what you set it to
  • rowheight returns whatever height the rows ARE not the height set by default row height

There are 3 values - so a simple getter / setter isnt sufficient
There may be times that you want the ActualRowHeight
And sometimes to know what value you originally set

RowHeight should be renamed (ha !) to “ActualRowHeight” or something to better indicate what it really is doing