I have a dialog with a CComboBox
in the DropList style. I want it to call my function (e.g. LoadData()
) when:
but NOT when the user is still typing text in #2.
Calling LoadData()
in the ON_CBN_SELCHANGE
handler works fine for #1, but for #2 this event fires on every keystroke instead of only on enter. In other words, if I have combobox items:
1
12
123
and I type 12
, it will trigger ON_CBN_SELCHANGE
once for 1
, once for 12
... but really I'm trying to type 123
, so I don't want those first 2 keystrokes to result in LoadData()
calls.
What's the correct way to implement this?
Further to the comments in your question, here is the answer:
CBN_SELENDOK
(and adjust the method name if you want to): void CMFCApplication1Dlg::OnCbnSelendokCombo1()
{
// TODO: Add your control notification handler code here
}
Now you can proceed as required.
CBN_SELENDOK
in the list, click the drop-down arrow and select the option to add the handler: