Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Combo box question

Combo box question

Combo box question

Hi everyone,
i have a little form that has 3 combo boxes, so two of them, have a few records to show and i use "displaycount property" to extend the height of the combo box but since the appl is running in different computers with different resolution and different monitors size, then on some computers the combo box that has a lot of records, the combo box extend to the bottom correctly, sometimes i can even see all the records in the combo box(w/o scrolling), sometimes i need to scroll down, no problem.

the problem is with other computers that have small monitors so the combo box that has a lot records, in this small monitors, tend to show the combo box to open up, instead of opening down, so i would like to know if is anything that programmatic can adapt the combo box according to the size and resolution ?
Please see picture attached for reference, as this combo box should be showing the records pointing down.
Thanks in advance

RE: Combo box question

this happens automatically, yes. How should it work differently? If you would force a combo to drop down, the number of visible items would not fully show. The combo works with the items popping up insteadof dropping down, so what reason do you have to change it?

You can control how many items are displayed via combobox.displaycount. Set that lower, and the space below the combobox can fit the list as dropdown instead of popup list. But a combo isn't broken, if that happens.

Bye, Olaf.

RE: Combo box question

Thanks for pop up here, but you see that picture i sent ?
in other computers with a diffent monitor and resolution, shows the combo box pointing down, as it should behave, for example in another computer with the same displaycount property the combo box it is pointing down
so how can make this happen ? if possible as it looks ugly.

RE: Combo box question

A combo box opening upward if there's not enough room to go down is the correct behavior. Test it yourself. In say, Word, pull a dialog (Font dialog has a couple of dropdowns) down near the bottom of the screen and open a dropdown.


RE: Combo box question

As I already said, the only thing you can do is reduce the displaycount. You can't force the list to drop down where there is not sufficient space, as that makes no sense.

And yes, I've seen your screenshot. It seems cropped to me, or the form itself also isn't displayed fully. The only thing I consider ugly here is, that you didn't adjust the width of columns to make the item list have the same width as the combo box has. There is some room to the bottom, too. It would be used if you reduce displaycount to - let's say - 6. This doesn't remove items, it just adds a scrollbar to the item list.

Bye, Olaf.

RE: Combo box question

The image is interesting. Is it possible that the combo box could extend beyond top or bottom of the screen if the size is small (like 640 x 480), and as Olaf mentions, the number of lines goes over no matter which direction, VFP selects the top pop-up because there is more room in that direction?

I think as Olaf said, the best thing to do is set the display count value to something like 3 or 4 and try it again.

Best Regards,

"Everything should be made as simple as possible, and no simpler."hammer

RE: Combo box question

Thanks, Scott.

Yes the screenshot even cuts off the list popping up, the screenshot still doesn't seem to be the full display, I see a status bar cut off.
I think the top titlebar of _screen is shown, so we see the full available space on top and from the behaviour can deduct the space below is less.

Anyway, I agree VFP will choose the direction with more room for items. As the displayed items are more than 7, your code already altered displaycount. If you leave it as the default 0, the max item count displayed without scrollbars is 7, when you read the help. If you see neither the _screen.height-form.top-combobox.top (pixels below combobox) nor form.top+combobox.top pixels (above combobox) can fit the list, you'd rather need to shrink down displaycount, landfla.

I only see a small benefit of displaying the full list, when there is the room for it. 7 is a well chosen default max item value, human perception tells us we can overview 7 items. The usual combobox only reveals a partial list, when it gets longer and you should stay with that design of the combobox.

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close