C++ program
-
In CView::OnDraw(CDC* pDC) or using the CDC *pDC=GetDC() member function //To Set font color COLORREF oldCol=pDC->SetTextColor (RGB(0,0,255));//Blue Color // use font to draw stuff //..... pDC->SetTextColor (oldCol);//restore old font color //the same Way to set back ground color COLORREF OldbkColor=pDC->SetBkColor (RGB(0,0,0)); //Do your drawing //...... //if U want to restore BK Color pDC->SetBkColor(OldbkColor);
-
In CView::OnDraw(CDC* pDC) or using the CDC *pDC=GetDC() member function //To Set font color COLORREF oldCol=pDC->SetTextColor (RGB(0,0,255));//Blue Color // use font to draw stuff //..... pDC->SetTextColor (oldCol);//restore old font color //the same Way to set back ground color COLORREF OldbkColor=pDC->SetBkColor (RGB(0,0,0)); //Do your drawing //...... //if U want to restore BK Color pDC->SetBkColor(OldbkColor);
-
-
For dialog based programs, you will have to override a handler WM_CTLCOLOR. This can change the colors of all the controls on a dialog and the color of the dialog itself. STUCK STUCK STUCK STUCK Stuck to Programming through an unbreakable bond :( My Articles | My Blog