Porter2

Hi,

is there any chance of getting a notification when I set the selection in a combobox with SetCurSel() The style of the combobox is CBS_DROPDOWNLIST. Normally I would get the selection change with ON_CBN_SELCHANGE but that doesn't work here because you have to select an item with the mouse or with the arrow keys for ON_CBN_SELCHANGE to work.

Does anyone has a suggestion for still getting a notification



Re: Windows SDK Combobox: No event on SetCurSel()?

Viorel.

If no other solutions, maybe you should generate the message manually after each SetCurSel Probably like this:

myList->SetCurSel(900000);

myList->SendMessage(WM_COMMAND, MAKEWPARAM(myList->GetDlgCtrlID(), CBN_SELCHANGE), LPARAM((HWND)myLyst));

Or perhaps you could call the handler explicitely:

myList->SetCurSel(900000);

myList->OnCbnSelchangeMyList();

I hope this makes sense.