Update released.
Included the EditDropDownList run-time property to enrich the in-cell editing functionality.
The EditDropDownList may be set at the BeforeEdit event, either to vbNullstring (default; off) or to a string each item separated by pipe characters. ("|")
It works similar to the ComboList Property of the vsFlexGrid.
However, I don't use the ComboBox class. I rely on the edit window and extended the combo functionality as can be seen at following screen:
So everything works as normal with just some additional windows. The dropdown button is a Static control with SS_OWNERDRAW and SS_NOTIFY which can't get focus. So the edit window will not get destroyed by a lost focus.
The actual dropdown window is a ComboLBox class window with WS_POPUP style. It also don't receive focus and can't be activated, it just "captures" the mouse and key inputs.
Depending on how the EditDropDownList property is set it imitates a "Dropdown Combo" or "Dropdown List" style ComboBox.
"Dropdown List": (Edit window with ES_READONLY; DroppedDown immediately)
"Dropdown Combo": (Edit window unchanged; certain behavior adjustments)Code:EditDropDownList = "ListItem 1|ListItem 2"
The additional EditDroppedDown run-time property can programmatically expand or collapse the dropdown list by code. In normal cases not needed.Code:EditDropDownList = "|ListItem 1|ListItem 2"




Reply With Quote