Help erasing text in window
-
Using Visual C++ 6.0 MFC in SDI application When my window gets redrawn, I want to display a message using pDC->TextOut(...) but I want a different message (of different length) displayed depending on the circumstances when the window gets redrawn. I do not understand how to erase the old message unless I keep a copy of the old text and rewrite it with the background color. If I just try to write a long text string with all blanks such as tstr = " " to erase the old message before I display the new message I have to make the text string extremely long as the character size for a space seems to be different then the character size for letters. Should I just display a rectangle of an appropriate size in the background color to erase my old text, or is there a better method of erasing this old text each time the window gets redrawn? Thanks
-
Using Visual C++ 6.0 MFC in SDI application When my window gets redrawn, I want to display a message using pDC->TextOut(...) but I want a different message (of different length) displayed depending on the circumstances when the window gets redrawn. I do not understand how to erase the old message unless I keep a copy of the old text and rewrite it with the background color. If I just try to write a long text string with all blanks such as tstr = " " to erase the old message before I display the new message I have to make the text string extremely long as the character size for a space seems to be different then the character size for letters. Should I just display a rectangle of an appropriate size in the background color to erase my old text, or is there a better method of erasing this old text each time the window gets redrawn? Thanks
Have you tried Invalidate () ???
Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.