Time:09-19
CodePudding user response:
try from the ComboBox derived new class handling WM_NCPAINT your WM_PAINT message
the certain properties of some controls are not support dynamic modification,
ComboBox has two child controls "list" and edit,
vc6 can //CSuperComboBox message handlers HBRUSH CSuperComboBox: : OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor) {//TODO: Change any attributes of the DC here If (nCtlColor==CTLCOLOR_LISTBOX) {//ListBox control, It is a COMBOLBOX, not a normal ListBox. Fit, //It is not a child window of combobox. If (m_listbox GetSafeHwnd ()==NULL) {M_listbox. SubclassWindow (pWnd - & gt; GetSafeHwnd ()); //too later to change the sytle! //no vscroll!!!!!! M_listbox. ModifyStyle (0, WS_HSCROLL | LBS_MULTICOLUMN); //you have to create a new list box? //see "Dynamically re - creating a list box" code project. RecreateComboLBox (& amp; M_listbox);//no messages? } } If (nCtlColor==CTLCOLOR_EDIT) {M_hEdit=pWnd - & gt; GetSafeHwnd (); } //HBRUSH gets=CComboBox: : OnCtlColor (pDC, pWnd, nCtlColor); Return gets; } VS a function can be directly take
Page link:https//www.codepudding.com/Softwareengineering/13502.html