How do you erase the CRectTracker and its styles?
Posted on 2004-09-13
Hi. I have a view which contains multiple static fields. When the user clicks on a static field, I add a CRectTracker over the static field. If there is another mouse click outside of the control with the CRectTracker, I want to delete the rect tracker and erase all remnants of it. I have tried simply deleting the rect tracker, redrawing the window, invalidating its rect, etc. Here is what I've tried:
// try clearing it's style
tracker->m_nStyle &= ~CRectTracker::hatchInside;
tracker->m_nStyle &= ~CRectTracker::dottedLine;
tracker->m_nStyle &= ~CRectTracker::resizeOutside;
// try invalidating its rect
// try redrawing the window it was used for
CWnd *trackingWnd = tracker->GetTrackingWnd();
// now just try deleting it.
tracker = NULL;
Unfortunatley, with all of this, I still end up with the outline of the tracker on the screen. I don't want to redraw the entire view because there is too much screen flicker. Anybody have any ideas?