Displaying list box on UserForm

N

Nam

How can I display a LisBox on a UserForm that has its boundaries extending
outside the boundaries of the UserForm? I am using MS Word 2000.

The LisBox is at the bottom of the UserForm. When a user clicks on the
ListBox, I want the ListBox to display like a Popup menu with its list of
items crossing over the bottom boundary of the UserForm.

I don't want to increase the height of the UserFrom. Keep in mind that the
Parent property of a UserForm control in VBA is Read-Only.

Thanks,
Nam
 
J

Jay Freedman

Nam said:
How can I display a LisBox on a UserForm that has its boundaries
extending outside the boundaries of the UserForm? I am using MS Word
2000.

The LisBox is at the bottom of the UserForm. When a user clicks on the
ListBox, I want the ListBox to display like a Popup menu with its
list of items crossing over the bottom boundary of the UserForm.

I don't want to increase the height of the UserFrom. Keep in mind
that the Parent property of a UserForm control in VBA is Read-Only.

Thanks,
Nam

You can't do this at all with a ListBox. Use a ComboBox control instead. A
ComboBox behaves this way without any additional programming -- if the list
is longer than the depth of the UserForm below it, the list just extends
past the edge of the UserForm.

If you want the ComboBox to prevent the user from typing anything in the
edit area that doesn't already exist in the list, set the box's
..MatchRequired property to True. Then it will behave just like a ListBox for
purposes of selecting from a fixed list, but it will also have the popup
behavior.
 

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

Top