I am working on an ATL control that has a simple CStatic text label. While I've managed to change the font in both OnInitDialog and OnPaint I cannot change the color. Basically it is a Property Sheet with a CStatic control on it. In the Constructor m_pArial is defined as: m_pArial->CreateFont(40, 0, 0, 0, 700, 0, 0, 0, 0, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH, "Arial"); And it is deleted in the destructor. Here is my code (it sets the font just fine - not the color). void CPropPage::OnPaint() { CPaintDC dc(this); // device context for painting CPen *pOldPen; CPen BluePen; BluePen.CreatePen(PS_SOLID, 1, RGB(0, 0, 255)); CBrush Brush(RGB(0, 0, 255)); CBrush *pOldBrush; pOldPen = dc.SelectObject(&BluePen); pOldBrush = dc.SelectObject(&Brush); m_Static_Title.SetFont(m_pArial); m_Static_Title.SetWindowText("Test"); dc.SelectObject(pOldPen); dc.SelectObject(pOldBrush); } Thank You
L
lpvoid
@lpvoid
Posts
-
Coloring text in an ATL Control -
Picture Controls and DialogsThank you, I'll take a look. lp
-
Picture Controls and DialogsI am having trouble getting a bitmap to display on a dialog. I've set the Picture Control in the window (Dialog) and set the Type property to Bitmap. I can get it to display a resource bitmap created in the editor and assigned to the control via the Image property. What I would like to do is have a dynamically drawn bmp displayed and updated as needed on this dialog. I know how to draw the bitmap just not how to get it thrown in to the Picture Control. Thank you for your time lp