c++ - Programmatically change combobox -


i need update combobox new value changes reflected text in it. cleanest way after comboboxhas been initialised , message.

so trying craft postmessage hwnd contains combobox.

so if want send message it, changing selected item nth item, postmessage like?

i guessing involve on_cbn_selchange, can't work right.

you want combobox_setcursel:

combobox_setcursel(hwndcombo, n); 

or if it's mfc ccombobox control can do:

m_combo.setcursel(2); 

i imagine if you're doing manually want sendmessage rather postmessage. cbn_selchange notification control sends back you when selection changed.

finally, might want add c++ tag question.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -