title: Why MouseMove event occurs after MouseUp event?
body: <p>In <code>WindowsForms</code> I just added event handlers as follows:</p>
  
  <pre><code>    private void Form1_MouseDown(object sender, MouseEventArgs e)
      {
          Debug.WriteLine($"=&gt; Form1_MouseDown, Clicks: {e.Clicks}, Location: {e.Location}");
      }
  
      private void Form1_MouseUp(object sender, MouseEventArgs e)
      {
          Debug.WriteLine($"=&gt; Form1_MouseUp, Clicks: {e.Clicks}, Location: {e.Location}");
      }
  
      private void Form1_MouseMove(object sender, MouseEventArgs e)
      {
          Debug.WriteLine($"=&gt; Form1_MouseMove, Clicks: {e.Clicks}, Location: {e.Location}");
      }
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>=&gt; Form1_MouseMove, Clicks: 0, Location: {X=17,Y=21}
  =&gt; Form1_MouseDown, Clicks: 1, Location: {X=17,Y=21}
  =&gt; Form1_MouseUp,   Clicks: 1, Location: {X=17,Y=21}
  =&gt; Form1_MouseMove, Clicks: 0, Location: {X=17,Y=21}
  </code></pre>
  
  <p>You can see that all events occurs in the same location, So my question is why is there a <code>MouseMove</code> event after <code>MouseUp</code> event?</p>
  
  <p>Also I tried similar code in WPF and <code>MouseMove</code> event <strong>NOT</strong> occurred.</p>
  
  <p>And I tried similar code in C++ and <code>MouseMove</code> event <strong>NOT</strong> occurred:</p>
  
  <pre><code>LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  {
      switch (message)
      {
       ...
  
      case WM_MOUSEMOVE:
          OutputDebugString(L"WM_MOUSEMOVE\n");
          break;
  
      case WM_LBUTTONDOWN:
          OutputDebugString(L"WM_LBUTTONDOWN\n");
          break;
  
      case WM_LBUTTONUP:
          OutputDebugString(L"WM_LBUTTONUP\n");
          break;
  
      default:
          return DefWindowProc(hWnd, message, wParam, lParam);
      }
      return 0;
  }
  </code></pre>