|
-
May 31st, 2007, 12:29 AM
#1
Thread Starter
New Member
ListBox vertical scrollbar
How can I find out that ListBoxe's vertical scrollbar is visible?
There is a property for the horizontal, but not for the vertical.
-
May 31st, 2007, 12:36 AM
#2
Hyperactive Member
Re: ListBox vertical scrollbar
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.
Prefix has no suffix, but suffix has a prefix.
-
May 31st, 2007, 12:38 AM
#3
Frenzied Member
Re: ListBox vertical scrollbar
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.
-
May 31st, 2007, 12:39 AM
#4
Re: ListBox vertical scrollbar
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.
-
May 31st, 2007, 12:40 AM
#5
Re: ListBox vertical scrollbar
 Originally Posted by Troy Lundin
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.
Shazzam!
-
May 31st, 2007, 12:48 AM
#6
Hyperactive Member
Re: ListBox vertical scrollbar
I was thinking more along the lines of deja vu.
Prefix has no suffix, but suffix has a prefix.
-
May 31st, 2007, 12:53 AM
#7
Thread Starter
New Member
Re: ListBox vertical scrollbar
Can you give me code that how I can do this?
-
May 31st, 2007, 01:01 AM
#8
Hyperactive Member
Re: ListBox vertical scrollbar
Are you serious? All three properties have been mentioned.
Lb is the listbox.
Code:
If Lb.ItemHeight * Lb.Items.Count > lb.Height Then
' Scrollbar visible
End If
I apologize.
Prefix has no suffix, but suffix has a prefix.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|