CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    M...N
    Posts
    220

    Simple question: Invalidate() vs InvalidateRect()

    M....
    I am wondering whether:
    1. InvalidateRect(NULL) is having the same effect as Invalidate().

    2. In MSDN, it says: " If bErase is TRUE for any part of the update region, the background in the entire region, not just in the given part, is erased. ".

    So is this mean if we use Invalidate(), then no matter how small the clip regions are, all client area will be set invalid? (Repaint the complete client area?)

    Thanks for you guys' help.

  2. #2
    Join Date
    Feb 2002
    Posts
    60
    Hi myron,
    for both of your questions the answer is true.

  3. #3
    Join Date
    Sep 2002
    Location
    DC Metro Area, USA
    Posts
    1,509

    Re: Simple question: Invalidate() vs InvalidateRect()

    Yes, if you pass in true for the erase param or specify Null for the rect param, InvalidateRect is the same as Invalidate. However it's usefulness is in specifying a rect and bErase = FALSE; this allows the just the clip region to be updated.

    It should also be noted that this behavior can be modified by overriding the OnEraseBkgnd handler; if you just return TRUE then the current background will not be redrawn, but the clip region will be whatever was specified by the call...
    bytz
    --This signature left intentionally blank--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured