title: OnLButtonUp not firing after mouse click for CStatic control
body: <p>I have a MFC application where I am trying to let the user draw a rectangle via mouse drag over a picture control.  I created my own PictureCtrl class subclassed by CStatic.  However, the OnLButtonUp() is not firing when I do any mouse clicks.</p>
  
  <pre><code>void PictureCtrl::OnLButtonDown(UINT nFlags, CPoint point) 
  {
      SetCapture();
  
      anchor = point;
      CRect rect(point,point);
  
      CDC* pDC = GetDC();
      pDC-&gt;DrawDragRect(&amp;rect, CSize(1,1), NULL, CSize(1,1), NULL, NULL);
      m_lastRect = rect;
      ReleaseDC(pDC);
  
      CStatic::OnLButtonDown(nFlags, point);
  
  }
  
  void PictureCtrl::OnMouseMove(UINT nFlags, CPoint point) 
  {
      if(GetCapture() == this) 
      {
          CRect rect(anchor, point);
          rect.NormalizeRect();
  
          CDC *pDC = GetDC();
          pDC-&gt;DrawDragRect(&amp;rect, CSize(1,1), &amp;m_lastRect, CSize(1,1), NULL, NULL);
          m_lastRect = rect;
          ReleaseDC(pDC);
  
          ReleaseCapture();
      }
  
      CStatic::OnMouseMove(nFlags, point);
  }
  
  void PictureCtrl::OnLButtonUp(UINT nFlags, CPoint point) 
  {
      if(GetCapture() == this) 
      {
          CDC *pDC = GetDC();
          CRect rect(0,0,0,0);
          pDC-&gt;DrawDragRect(rect, CSize(1,1), &amp;m_lastRect, CSize(1,1), NULL, NULL);
          ReleaseDC(pDC);
  
          ReleaseCapture();
      }
  
      CStatic::OnLButtonUp(nFlags, point);
  }
  </code></pre>
  
  <p>If anyone could give me any insight to why the OnLButtonUp is not firing that would be appreciated.  Is it because the OnMouseMove is eating up all the calls when i drag my mouse?  </p>
  
  <p>Also, can anyone give me a suggestion on how to modify my code so that if a rectangle has already been drawn, if the user draws a new one the old rectangle will be deleted?</p>