By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Find 'TopIndex' in a listbox

P: n/a
Is there any way to find the ListIndex of the first items displayed in
a listbox that is partially scrolled (i.e. the equivalent of TopIndex
for a VB listbox)?

I want to be able to redisplay the listbox at exactly the same
position after an event that causes the scrollbar to reset to the top.
I've seen Stephen Lebans method for setting the scrollbar so that a
specific item is at the top of the box, but what I don't see how to do
is find out what the item at the top of the box is before the
scrollbar resets - Stephen's examples rely on you knowing beforehand
the ListIndex of the row you want to display.

(Just to complicate thing, the listboxis resizable, so i don't know
how many rows it will display at runtime).

Thanks!

Ian

Jun 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I've added support for ListBox ScrollBars to the GetSetScrollBar solution. I
haven't published it yet to my site. If you send me an EMail I'll trply with
the updated MDB.
My*********@MyLastName.com
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"ians" <ia******@yahoo.co.ukwrote in message
news:11**********************@p47g2000hsd.googlegr oups.com...
Is there any way to find the ListIndex of the first items displayed in
a listbox that is partially scrolled (i.e. the equivalent of TopIndex
for a VB listbox)?

I want to be able to redisplay the listbox at exactly the same
position after an event that causes the scrollbar to reset to the top.
I've seen Stephen Lebans method for setting the scrollbar so that a
specific item is at the top of the box, but what I don't see how to do
is find out what the item at the top of the box is before the
scrollbar resets - Stephen's examples rely on you knowing beforehand
the ListIndex of the row you want to display.

(Just to complicate thing, the listboxis resizable, so i don't know
how many rows it will display at runtime).

Thanks!

Ian

Jun 8 '07 #2

P: n/a
Hi Stephen

tried emailing you as you suggested, but maybe it got lost as spam.
Anyway i'd still be interested in your solution.
Thanks

ian

On Jun 8, 2:41 am, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
I've added support for ListBox ScrollBars to the GetSetScrollBar solution. I
haven't published it yet to my site. If you send me an EMail I'll trply with
the updated MDB.
MyFirstN...@MyLastName.com

--

HTH
Stephen Lebanshttp://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

"ians" <ians0...@yahoo.co.ukwrote in message

news:11**********************@p47g2000hsd.googlegr oups.com...
Is there any way to find the ListIndex of the first items displayed in
a listbox that is partially scrolled (i.e. the equivalent ofTopIndex
for a VB listbox)?
I want to be able to redisplay the listbox at exactly the same
position after an event that causes the scrollbar to reset to the top.
I've seen Stephen Lebans method for setting the scrollbar so that a
specific item is at the top of the box, but what I don't see how to do
is find out what the item at the top of the box is before the
scrollbar resets - Stephen's examples rely on you knowing beforehand
the ListIndex of the row you want to display.
(Just to complicate thing, the listboxis resizable, so i don't know
how many rows it will display at runtime).
Thanks!
Ian

Jun 18 '07 #3

P: n/a
Sorry Ian,

Your reply ended up in my SPAM Email folder. I've emailed you the modified
MDB.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"ians" <ia******@yahoo.co.ukwrote in message
news:11**********************@n2g2000hse.googlegro ups.com...
Hi Stephen

tried emailing you as you suggested, but maybe it got lost as spam.
Anyway i'd still be interested in your solution.
Thanks

ian

On Jun 8, 2:41 am, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
>I've added support for ListBox ScrollBars to the GetSetScrollBar
solution. I
haven't published it yet to my site. If you send me an EMail I'll trply
with
the updated MDB.
MyFirstN...@MyLastName.com

--

HTH
Stephen Lebanshttp://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

"ians" <ians0...@yahoo.co.ukwrote in message

news:11**********************@p47g2000hsd.googleg roups.com...
Is there any way to find the ListIndex of the first items displayed in
a listbox that is partially scrolled (i.e. the equivalent ofTopIndex
for a VB listbox)?
I want to be able to redisplay the listbox at exactly the same
position after an event that causes the scrollbar to reset to the top.
I've seen Stephen Lebans method for setting the scrollbar so that a
specific item is at the top of the box, but what I don't see how to do
is find out what the item at the top of the box is before the
scrollbar resets - Stephen's examples rely on you knowing beforehand
the ListIndex of the row you want to display.
(Just to complicate thing, the listboxis resizable, so i don't know
how many rows it will display at runtime).
Thanks!
Ian


Jun 20 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.