It works prefectly. A solution I would never have come up with. I was mired in checking font types, border widths etc.
I will add something like nTargetCount = min(.ListCount,nMaxLinesShowing) and replace .ListCount with it.
Many Thanks
>Don,
>
>
>
with this.lstGrow
> .ListIndex = .ListCount
> do while ( .TopIndex != 1 )
> .Height = .Height + 1
> .ListIndex = 1
> .ListIndex = .ListCount
> enddo
>endwith
>
>this seems to work. shuffling the ListIndex around causes it to recalculate the .TopIndex, and once that hits 1 you've got the whole thing displayed.
>
>Of course you might want to add some other boundary conditions like not letting .Height exceed some boundary limit.
>
>>If I know the number of lines (or items) that a listbox has how do I calculate the height to set the listbox so that the listbox does not show scroll bars (too small) and does not show an empty line (too large).
>>IntegralHeight = .t.,3-D special effect.
Best Regards
Don Simpson