Multiple CComboBox share the same data
I have an MFC dialog with 32 CComboBoxes where everyone has the same data in the list. This will take a while, and it looks like part of the delay is the time I need to spend using InsertString () to add all the data to 32 controls. How can I subclass CComboBox so that 32 instances use the same data?
0
source to share
4 answers
The owner you drew will go in one direction at your request - you'll be writing a fair piece of code, but you won't have to add data to all of them. " CComboBox :: DrawItem "
Support.microsoft has this article on Subclassing Combo Field, which may also be of interest " How to Subclass CListBox and Cedit Inside CComboBox "
Indeed, one has to ask if it's worth the effort and a lot of it depends on things like
- number of entries in the list
- number of impressions in the dialog
- volatility of combo content
- Optoisation elsewhere
- do not draw until the screen is complete
- will create a dialogue only once and show it again.
- using one combination but showing it in different places at different times
0
source to share