Click to See Complete Forum and Search --> : ComboBoxEx: Anybody know how to make this read-only?


May 3rd, 1999, 05:49 PM
CEdit* pCombo = (CEdit*)GetDlgItem(IDC_XXXX); // XXXX is the name of you comboboxex
pCombo->SetReadOnly();

The above code doesn't work, why not and what is the correct code?

Troy T
May 3rd, 1999, 06:15 PM
To my experience (and this could be wrong) but the SetReadOnly() function only works on edit boxes. I don't think it works on combo boxes, and if it does work on them, I would guess that it only works when the ComboBox has the DROPDOWN style (combo + edit), rather than the just combo style of DROPLIST.

- Troy