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


Combobox drop down list on top not bottom

Combobox drop down list on top not bottom

Combobox drop down list on top not bottom

Combobox drop down list on top not bottom

Any ideas why a combobox would popup above the combobox rather than below? I am making a 7" tablet app. It works fine in development but on the tablet the drop down list appears above the combobox.



RE: Combobox drop down list on top not bottom

That's automatic, if the list does not fit below.

Bye, Olaf.

RE: Combobox drop down list on top not bottom

As far as I know, you have no control over this. The placement of the list depends on how much space there is above or below the combo.

This is not a Foxpro issue, nor is it directly related to the fact that you are running on a tablet (except that the screen size obviously affects the issue).


Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Combobox drop down list on top not bottom

There is an alternative here that takes just a little bit of work, but also has other advantages that the combobox doesn't have.
What you do is use 2 controls, and "trick" the appearance of a combo box. You can even use the combobox control as one of the two controls, though Text Box with a picture image can also be preferable if you want the more modern Office look of the dropdown indicator in the box.
What you do is, create a text box, the size you want. Put the graphic at the end of the texbox to make it look to the user like a dropdown indicator (you can use enable/disable versions of the graphic if the list is empty as well).
Next, use either a listbox or a grid, which gives you control to determine where to position it, and how many rows you want to make available. One thing I like about using a grid this way (and you just set it's Visible/Invisible property to the click behavior/lost focus behavior or the text box), is you can then maneuver through list items with the mouse scroll wheel. With a combo box, the scroll wheel is only recognized if your over the vertical scroll line marker, where as in a Grid, the mouse wheel is recognized automatically as a means of traversing the list. If you use a grid, make it headerless. You can then use the OBJTOCLIENT() function for placement of the grid relative to the item, and you can either fix its display length (2, 3, 20) rows to show, and make scroll automatic. Its a little bit of work, but it can produce better results and user experience than the dropdown, and you have total control where the items (and how many) it displays in the "drop down".

Best Regards,

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

RE: Combobox drop down list on top not bottom

If the combobox is at the bottom of the form and the form is on the bottom of the tablet display, no such trickery will make it better. Why so much effort in such a thing? If you think it's important the Combobox item list should drop to the bottom, put it higher, or shrink the number of items shown, that will be determined by the Combobox.DisplayCount, setting that lower is the easiest way to get the list drop down.

You don't show the form, so many things are guesswork, but if the combo is very near the form borders, a solution rolling your own Combobox replacement with textbox+image+listbox will not enable the list to overlap with the form border, if there is room towards the bottom of the display, to get that equally, your dropdown list would even need to become a whole new form with a listbox or grid inside i, so you can position it as you like, but I'd go for decrementing DisplayCount as first level solution. Or live with this automatism. Nothing is broken, it just looks unusual.

Bye, Olaf.

RE: Combobox drop down list on top not bottom

Thank-you Mike, Olaf and Scott. Setting the displaycount to 6 worked. The problem occurred when I moved the combobox below another combobox. I did try to google several ways to find this obvious answer (to those who know) but did not find one. I am working on a touchscreen app for an HP Stream 7" tablet. The app has turned out suprisingly well using FoxPro. I am blessed to be able to still develop FoxPro apps in 2017. For nearly 20 years tek-tips has been a lifesaver for me. I would not have survived as a developer without my amazing tek-tips ! Thank-you once again to each of you!



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