Home > Software engineering > VS2010 Combo - the color of the text box control under the Unicode cannot change
VS2010 Combo - the color of the text box control under the Unicode cannot change
Time:10-11
Just to change from the original project multibyte to Unicode, found above controls, is VS2010 Combo box control, such as I want to change the control to the green, before I am OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor) function, PDC - & gt; SetBkColor (bkColor); PDC - & gt; SetTextColor (textColor); It should be possible, but after to Unicode, haven't success, try many ways to change only the color of the part, when selecting the drop-down box will be displayed after the selected color does not change, can someone encountered similar problems, how do I operation can change the color?
CodePudding user response:
This OnPaint create a brush
HPEN HPEN, hOldPen;//brush HPen=CreatePen (PS_SOLID, 2, RGB (0, 255));//generated red color brush brush width 5 pixels HOldPen=(HPEN) SelectObject (HDC, HPEN);//into the brush device field condition