Need to calculate numbers of lines in listbox?

  • Thread starter Thread starter new
  • Start date Start date
N

new

Hello
I am using the following to calculate the number of visible lines in
a listbox. This works, but when I add a horizontal scroll bar it
does not work correctly. How can I subtract the size of the
horizontal bar to maintain correct value?

number_of_lines = listbox1.Height / listbox1.ItemHeight
 
Hi,

new said:
Hello
I am using the following to calculate the number of visible lines in
a listbox. This works, but when I add a horizontal scroll bar it
does not work correctly. How can I subtract the size of the
horizontal bar to maintain correct value?

number_of_lines = listbox1.Height / listbox1.ItemHeight

Try using listbox1.ClientSize.Height
 
Back
Top