Need to calculate numbers of lines in listbox?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • new

    Need to calculate numbers of lines in listbox?

    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.ItemHe ight


  • Bill McCarthy

    #2
    Re: Need to calculate numbers of lines in listbox?

    Hi,

    "new" <null@null.comw rote in message
    news:OiBa2M4GJH A.1308@TK2MSFTN GP02.phx.gbl...
    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.ItemHe ight
    >
    Try using listbox1.Client Size.Height

    Comment

    • new

      #3
      Re: Need to calculate numbers of lines in listbox?

      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.ItemHe ight
      >
      Try using listbox1.Client Size.Height
      >
      I can't find it?


      Comment

      Working...