By default, whenever a control is repainted, all its client area / region will be repainted like as using Invalidate() not Invalidate(Region).
If I call Invalidate() myself to repaint the control, it will be OK (I will pass in a specified Region to make it invalidated only). However the control may be invalidated by some code that I can't control (this will invalidate all the control and I don't want this to happen, just some Region is in need to be invalidated).
I've tried overriding OnInvalidated method, but its argument (InvalidateEventArgs) has only a property called InvalidRect (type of Rectangle, not a Region). We all know that calling to Invalidate() will raise the Paint event of the control (for the whole control), calling to Invalidate(Region) will raise the Panit event of the control (for a specified Region on the control), and so I wonder how Invalidate(Region) tells the underlying Paint event raising mechanism to know the Region being painted???
Or there is something special here (compared to almost other events such as MouseUp, MouseDown, MouseMove, KeyPress,...)?
Please help me solve this problem, or tell me if that's impossible. At least I want to know the answer to the question in bold above. Of course, knowing the answer to that question will help me create the control I want. (as mentioned in the title).
Your help would be highly appreciated! Thanks!
VipHaLong