General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only