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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -