c++ - Default item showing in non-editable comboBox -
i have non/editable combobox in gui c++ application (visual studio 2012) , want select default item/value in box collection (all items/value). hope can me make possible?
let's have filled disabled combobox this:
lpctstr s[] = {_t("blue"), _t("red"), _t("yellow")}; ccombobox* pcombo = (ccombobox*)getdlgitem(idc_combo_color); if(pcombo) { for(int i=0; i<3; ++i) { pcombo->addstring(s[i]); } pcombo->setcursel(1); // <- sets default value. here "red" }
as illustrated in code snippet, setting selected item (index based)
Comments
Post a Comment