|
-
May 29th, 2000, 08:08 PM
#1
Thread Starter
Lively Member
Hi!
Is there any way to enable scrolling in a listbox, which allows no entries (enabled=false)???
Thanks for your help
-
May 29th, 2000, 08:25 PM
#2
If you disable the listbox, scrolling will not be possible. However, you can leave it enabled, and as soon as the user clicks an entry, you can set the ListIndex to -1 which means no entries are selected (and the highlight will be removed from the entry that the user clicked). For example:
Private Sub List1_Click()
List1.ListIndex = -1
End Sub
-
May 29th, 2000, 08:37 PM
#3
Frenzied Member
You could put a vertical scroll bar over the top of list box scroll bar and scroll it that way.
Code:
Option Explicit
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 20
List1.AddItem "item " & i
Next i
List1.Enabled = False
VScroll1.Max = List1.ListCount - 1
End Sub
Private Sub VScroll1_Change()
'choose one of the following:
'List1.ListIndex = VScroll1.Value
List1.TopIndex = VScroll1.Value
End Sub
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
|