Updating Different Areas of a Control
-
I have a control which displays information in 3 different places on itself. When one piece of information changes, I have to repaint the whole control. Sometimes, only one piece of information changes many times very quickly, so I end up re-drawing the whole control for everytime. Is there a way to mark a region or part of a control that needs to be re-drawn, not the whole thing? -Mark Lenz
-
I have a control which displays information in 3 different places on itself. When one piece of information changes, I have to repaint the whole control. Sometimes, only one piece of information changes many times very quickly, so I end up re-drawing the whole control for everytime. Is there a way to mark a region or part of a control that needs to be re-drawn, not the whole thing? -Mark Lenz
- Call CWnd::InvalidateRect() and pass it the RECT of the area that needs to be redrawn.
- In your painting code, check the DC's invalid region (it's a CDC or API function, I can't remember the name ATM) and only repaint that region.
--Mike-- http://home.inreach.com/mdunn/ While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate. :love: your :bob: with :vegemite: and :beer: Sonork - 100.10414 AcidHelm