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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox drop down list on top not bottom 3

Status
Not open for further replies.
Sep 17, 2001
673
US
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.

Regards,

Rob
 
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

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Rob,
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,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

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

 
[highlight #73D216]Thank-you Mike, Olaf and Scott.[/highlight] 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!



Regards,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top