|
-
Jan 12th, 2008, 08:28 AM
#1
Thread Starter
Frenzied Member
-
Jan 12th, 2008, 08:38 AM
#2
Re: Auto Select Item In ListBox
Code:
Private Sub List1_Scroll()
Dim i As Long
For i = 0 To List1.ListCount - 1
List1.Selected(i) = True
Next
End Sub
Something like that possibly but when is the item added exactly? because once you have scrolled to the bottom you cant go any further.
-
Jan 12th, 2008, 09:09 AM
#3
Thread Starter
Frenzied Member
Re: Auto Select Item In ListBox
I tried your code mate but selecting any item in the ListBox directly selects the last item in the ListBox. Actuually I must confess that I framed my question a bit wrongly. I should have stated it clearly that when scrolling, I want to retrieve the item to which the user has scrolled to & not necessarily select that item & this code does that:
Code:
Private Sub List1_Scroll()
MsgBox List1.List(List1.TopIndex)
End Sub
If the ListBox has 5 items, say Item1.....Item5, then scrolling down with the mouse, if Item2 becomes visible in the ListBox, the message box says Item2. If the user scrolls to Item3 making it visible, then the message box displays Item3 so on & so forth. This is exactly what I wanted.
Once again sorry for the oversight.
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
-
Jan 12th, 2008, 08:55 PM
#4
Re: Auto Select Item In ListBox
So, is this resolved for you?
-
Jan 12th, 2008, 09:44 PM
#5
Thread Starter
Frenzied 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
|