Make Listbox Grow

ddrew

seasoned user
Local time
Today, 14:48
Joined
Jan 26, 2003
Messages
911
I have a listbox on a report and in order to keep ithings tidy I want it to fit the contents. I found this piece of code:
Code:
Dim getListboxCountBeaters As Integer
Dim setHeight As Integer

getListboxCountBeaters = Me.listBeaters.ListCount
' Adjust Number Accordingly
setHeight = 217

Me.listBeaters.Height = getListboxCountBeaters * setHeight
Which dosen't work as I think it should, from reading the description it should count the amount of records and then set the height accordingly, but it seems to just set it bigger regardles of the amount of recored.

Can anyone see what is wrong please?
 
I can't see anything wrong with the code although I use a slightly different way of doing the same thing

listBeaters.Height =listBeaters.ListCount * 217
 
Last edited:
I can't test this just now but I think that Integral Height property for the list box should be disabled.
Also, that 217 should be the height for one row and this depend of the font size that you use. What if you use a decreased value ?
 

Users who are viewing this thread

Back
Top Bottom