How can I find out that ListBoxe's vertical scrollbar is visible?
There is a property for the horizontal, but not for the vertical.
Printable View
How can I find out that ListBoxe's vertical scrollbar is visible?
There is a property for the horizontal, but not for the vertical.
Well you could take the ItemHeight property, multiply it by the number of items in the listbox and if it is greater than the height of the listbox then the scrollbar would be visible.
That was pulled out of thin air so there may be an easier way.
There is a ScrollAlwaysVisible property but even if you set this to False, the vertical scroll bar will still appear if the list items take up more than the vertical space available in the list box. It will hide the vertical scroll bar if the list items take up less than the vertical space available in the list box.
If the ItemHeight property multiplied by the Items.Count property is greater than the Height property then there are too many items to display so the scroll bar must be visible.
Shazzam!Quote:
Originally Posted by Troy Lundin
I was thinking more along the lines of deja vu.Quote:
Shazzam!
Can you give me code that how I can do this?
Are you serious? All three properties have been mentioned.
Lb is the listbox.
I apologize.Code:If Lb.ItemHeight * Lb.Items.Count > lb.Height Then
' Scrollbar visible
End If