Re: Strange CComboBox::PresubclassWindow problem
Just point out the obvious solution
m_cboValue[iValueIndex].Create(WS_VISIBLE | WS_CHILD | CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP, rectItemCombo, this, nID);
m_cboValue[iValueIndex].SetItemHeight(....);
AliR.
"Eric Margheim" <NOSPAM***eric@prism-grp.com***NOSPAM> wrote in message
news:OcPKkBnkHHA.3388@TK2MSFTNGP03.phx.gbl...
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:2p5443dga7chmq2r1n35vnk0ge2h228fip@4ax.com...
You can't do it in the Create method for this. You can only do it in
PreSubclassWIndow.
You have not said how the control is "created dynamically" so it is
essential to see the
code.
The "unused" field is irrelevant.
There is no reason to worry about a redundant SetItemHeight; setting it
twice won't
matter.
Note that you will never get a message about when to set the item height
if you have
LBS_OWNERDRAWFIXED because there is only one message sent, and it is sent
before the
control is bound to your subclass.
You should not need to create the control dynamically (there are lots of
good reasons to
create controls dynamically, and a truly massive number of bad reasons.
All too many
times the reason chosen is one of the bad reasons, so please justify the
need to create it
dynamically)
joe
I have a CWnd object that is part of a CPropertyPage or CDialog. The
object is created and destroyed based upon events in the dialog. All of
the controls within the object are dynamically created based upon a
complex table structure in our database. Using an .rc file for this
would not make sense in this case.
I create it as follows:
m_cboValue[iValueIndex].Create(WS_VISIBLE | WS_CHILD | CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP, rectItemCombo, this, nID);