Link to home
Start Free TrialLog in
Avatar of atari
atari

asked on

print preview doesn't work !!!

I have implemented a print preview in my mdi-application. When the print preview is called the following OnDraw-function will be executed:

void CMyView::OnDraw(CDC* pDC)
{
  CString text=_T("This is a test");
  pDC->SetTextColor(RGB(255,0,0)); // or any other color
  pDC->SetBkColor(::GetSysColor(COLOR_WINDOW));
  GetClientRect(rect);
  pDC->DrawText(text,-1,rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
}

There is now a problem:
In print preview the text color will not be displayed !!!
The text string will always painted in black !!!

How can I change the color to that I want to have in print preview ?
I can debug the above code and the text color is the one I wanted to have but the screen shows always a black text !!!

Any ideas about that ?
ASKER CERTIFIED SOLUTION
Avatar of galkin
galkin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atari
atari

ASKER

Thank you, I will try it with a color printer and then I hope that the print preview shows my text in color.

Cannot try it at once, so I will graduade you before.

Bye,
atari