How to show drop-down list when set focus in ComboBox edit?

613 Views Asked by At

I want to implement auto-complete in ComboBox. As the first step, when a user clicks on the edit box and before typing anything, it should show the drop-down list with all available choices.

void ...::OnCbnSetfocus()
{
    if (!GetDroppedState())
    {
        ShowDropDown(TRUE);
    }
}

One issue is that if user clicks the drop-down button, the drop-down list appears and quickly disappears. To address that I think I need to subclass ComboBox to intercept the "click drop-down button" event and not pass it along the chain. But after some searching, I don't seem to find what event it is.

0

There are 0 best solutions below