我画了根水平直线,可以用鼠标上下移动这根线
时间一长,Invalidate()就罢工了
为什么?

解决方案 »

  1.   

    应该是你程序的事.用鼠标上下移动这根线可以在ONMOUSEMOVE
    中直接画, 没必要Invalidate().
      

  2.   

    你不nvalidate()怎么擦掉原来的?
    而且背景不是单一的颜色,不能用背景色来覆盖
      

  3.   

    ResInvalidates the entire client area of CWnd. The client area is ed for painting when the next WM_PAINT message occurs. The region can also be validated before a WM_PAINT message occurs by the ValidateRect or ValidateRgn member function.The bErase parameter specifies whether the background within the update area is to be erased when the update region is processed. If bErase is TRUE, the background is erased when the BeginPaint member function is called; if bErase is FALSE, the background remains unchanged. 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. Windows sends a WM_PAINT message whenever the CWnd update region is not empty and there are no other messages in the application queue for that window.
      

  4.   

    在拖动过程中, 只显示一个虚线.
    用SetROP2(R2_NOP),
    两次画一样的就消掉了.VC RC DIALOG EDIT 就是这样.