Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Down arrow in Combo
Message
From
01/11/2000 08:09:47
 
 
To
29/10/2000 18:08:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00435767
Message ID:
00436623
Views:
21
>I've searched for information on this and have seen others have experienced similar problems yet I haven't been unable to locate an explaination/solution.
>
>I developed a treeview like Combobox Class. When you select an item in the combo (type Array), if the item has children, the combo automatically drops down with a list of its children. You can then select a child item. If it has children, then they drop down, and so on.
>
>This is done by rebuilding the Items array after an item is selected and then automatically dropping down the combo using KEYBOARD "{ALT+DNARROW}"
>
>Everything works fine except when there are only a few children of a selected item, three for example, and you either select an item with no children or select outside of the list to not change the current item. In this case when you select the dropdown arrow on the combo again, the open combo loses the rightside scroll bar and a downarrow is placed as the last item in the list (item 4 in this example).
>
>If the child item in this case does have its own children, the combo drops down fine with the scroll bar.
>
>Has anyone figured out when the down arrow appears instead of the scroll bar?
>
>Any ideas are appreciated.

Answering my own question:

I figured out that the ListCount property (read-only) of the dropdown is determined by the number of elements in the item list BEFORE the DropDown method of the combo is called. If you alter the item list in the DropDown, as I was doing, it is possible that ListCount will not equal number of items in the list. When ListCount is less than the DisplayCount property, no scroll bars are shown. If you now increase the item list with a number of elements greater than DisplayCount in the DropDown method, the combo will dropdown thinking that there are less elements than DisplayCount and will not show the scroll bars. But, somehow the combo knows enough to put a down arrow as the last element of the list.

I'm still working on a solution.

Question now is, is there anyway to determine if the dropdown was closed by the user clicking outside of the list. In this case, neither the InteractiveChange, Click, or MouseDown events fire.

FYI
Previous
Reply
Map
View

Click here to load this message in the networking platform