Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Clear text from a device context. Pin
CPallini12-Dec-07 2:13
mveCPallini12-Dec-07 2:13 
GeneralRe: Clear text from a device context. Pin
Mr Simple12-Dec-07 2:38
Mr Simple12-Dec-07 2:38 
GeneralRe: Clear text from a device context. Pin
CPallini12-Dec-07 2:54
mveCPallini12-Dec-07 2:54 
GeneralRe: Clear text from a device context. Pin
Mr Simple12-Dec-07 4:47
Mr Simple12-Dec-07 4:47 
GeneralRe: Clear text from a device context. Pin
CPallini12-Dec-07 5:12
mveCPallini12-Dec-07 5:12 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery12-Dec-07 6:30
Mark Salsbery12-Dec-07 6:30 
GeneralRe: Clear text from a device context. Pin
Mr Simple12-Dec-07 7:12
Mr Simple12-Dec-07 7:12 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery12-Dec-07 7:31
Mark Salsbery12-Dec-07 7:31 
You've used rMoveTo before it's initialized. You shouldn't need
the second (rMoveTo) rect.

This should be enough:
//
// A gloabal rectangle.
CRect rTextMain;


//
// In my timer;
InvalidateRect(&rTextMain); // Your steps said to do this after, I tried both.

rTextMain.top = val1; rTextMain.left.......

UpdateWindow();



//
// In OnPaint;
CFont newFont;
newFont.CreateFont(15, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, _T("MS Sans Serif"));
CFont *oldFont = dc.SelectObject(&newFont);

CString sWords = "test";
dc.DrawText(sWords, &rTextMain, DT_TOP | DT_LEFT)


The WM_ERASEBKGND should take care of the invalidated rect.
Then the WM_PAINT handler should draw the text at the new location.

I don't see anything related to transparency or images.

Mark


Mark Salsbery
Microsoft MVP - Visual C++


Java | [Coffee]

GeneralRe: Clear text from a device context. Pin
Mr Simple12-Dec-07 22:43
Mr Simple12-Dec-07 22:43 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery13-Dec-07 5:48
Mark Salsbery13-Dec-07 5:48 
GeneralRe: Clear text from a device context. Pin
Mr Simple13-Dec-07 6:33
Mr Simple13-Dec-07 6:33 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery13-Dec-07 7:44
Mark Salsbery13-Dec-07 7:44 
GeneralRe: Clear text from a device context. Pin
Mr Simple14-Dec-07 1:22
Mr Simple14-Dec-07 1:22 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery14-Dec-07 4:47
Mark Salsbery14-Dec-07 4:47 
GeneralRe: Clear text from a device context. Pin
Mr Simple14-Dec-07 6:58
Mr Simple14-Dec-07 6:58 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery14-Dec-07 8:52
Mark Salsbery14-Dec-07 8:52 
GeneralRe: Clear text from a device context. Pin
Mr Simple16-Dec-07 22:12
Mr Simple16-Dec-07 22:12 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery17-Dec-07 5:50
Mark Salsbery17-Dec-07 5:50 
GeneralRe: Clear text from a device context. Pin
Mr Simple19-Dec-07 2:08
Mr Simple19-Dec-07 2:08 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery19-Dec-07 6:14
Mark Salsbery19-Dec-07 6:14 
GeneralRe: Clear text from a device context. Pin
led mike12-Dec-07 7:47
led mike12-Dec-07 7:47 
GeneralRe: Clear text from a device context. Pin
Mark Salsbery12-Dec-07 7:58
Mark Salsbery12-Dec-07 7:58 
GeneralRe: Clear text from a device context. Pin
Nelek12-Dec-07 3:14
protectorNelek12-Dec-07 3:14 
QuestionUsing SendVirtualKey method? Pin
Benny_Lava12-Dec-07 1:03
Benny_Lava12-Dec-07 1:03 
GeneralMulti column combo box Pin
panthal12-Dec-07 0:33
panthal12-Dec-07 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.