|
-
Feb 21st, 2000, 11:13 AM
#1
Thread Starter
Junior Member
Hi,
As you know, a scrollbar automaticaly appears on a listbox.
I'm just trying to detect in my app. when this scrollbar appears, thats all...
Thanks.
-
Feb 21st, 2000, 11:54 AM
#2
Try checking for the WS_VSCROLL Flag in the Listbox's Window Style, ie.
Code:
'Add a Timer, a Listbox and 2 Command Buttons to a Form..
'
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_VSCROLL = &H200000
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
'Check if the Listbox has the WS_VSCROLL Style
Caption = IIf(GetWindowLong(List1.hwnd, GWL_STYLE) And WS_VSCROLL, "Scrollbar Visible", "Scrollbar Hidden")
End Sub
Private Sub Command1_Click()
'Add an Item to the List
List1.AddItem "Item " & List1.ListCount + 1
End Sub
Private Sub Command2_Click()
'Remove an Item from the List
List1.RemoveItem List1.ListCount - 1
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert
-
Feb 22nd, 2000, 07:23 AM
#3
Thread Starter
Junior Member
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
|