Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to calculate Listbox height
Message
From
13/11/2003 08:54:32
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00849333
Message ID:
00849474
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform