Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box question

Status
Not open for further replies.
Jan 20, 2007
237
US
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
 
 http://files.engineering.com/getfile.aspx?folder=a8fddfd9-8e77-4338-b29b-209b08beb567&file=comboopeup.png
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.
 
Olaf,
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.
 
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.

Tamar
 
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.
 
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,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top