简体   繁体   中英

How do I disable a CComboBox while having it selectable for clipboard copy?

So first off, I have a CComboxBox that can only be obtained by GetDlgItem(cbID). This condition cannot be changed.

With this combobox, I can edit the text and show the dropdown items, but I want to disable those features.

I only know how to disable a Windows Object, for example...

GetDlgItem(cbID)->EnableWindow(FALSE);

But this disables both mouse and keyboard inputs, which doesn't allow me to highlight the text and copy it to a clipboard.

How would one disable a dropdown and editable feature while having it highlightable to copy to a clipboard?

The combo box style is probably CBS_DROPDOWN. If you cahge the style to CBS_DROPDOWNLIST you will remove the child edit control embedded within the combo box. That would prevent anyone from entering data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM