Positioning in a LIstBox

G

Guest

I have a listbox on a form. Because of limited area on the form, I cannot
make the listbox large enough to display all of the possible values therefore
there is a vertical scrollbar.

I need to be able to position a particular entry at the top of the listbox.
For example, if there are 10 total items in the listbox and I can only
display the first five entries, how do I make entry number 8 at the top of
the listbox?

Thanks in advance for your help?
 
A

Andi Mayer

I have a listbox on a form. Because of limited area on the form, I cannot
make the listbox large enough to display all of the possible values therefore
there is a vertical scrollbar.

I need to be able to position a particular entry at the top of the listbox.
For example, if there are 10 total items in the listbox and I can only
display the first five entries, how do I make entry number 8 at the top of
the listbox?

Thanks in advance for your help?

Me.ListBox.Selected(8) = True
 
G

Guest

thanks for responding....however that does not work...it selects item number
8 but it does not position that item to the top of the listbox...any other
ideas?
 
A

Andi Mayer

thanks for responding....however that does not work...it selects item number
8 but it does not position that item to the top of the listbox...any other
ideas?
A lot

first look in the help
second look at other properties of the listbox

third

Me.ListBox.Selected(8) = True
Me.List6 = Me.List6.ItemData(8)

and if you tell me now: this is not the top, it's the bottom

then it's time to calculate (up to you) which to select and which
itemdata to use.

And if you tell me now: it's the 9 which is selected, then look in the
HelpFile, it will tell you why
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top