title: ObjectDisposedException from core .NET code
body: <p>I'm having this issue with a live app.</p>
  
  <p>(Unfortunately this is post-mortem debugging - I only have this stack trace. I've never seen this personally, nor am I able to reproduce).</p>
  
  <p>I get this Exception:</p>
  
  <pre><code>message=Cannot access a disposed object.
  Object name: 'Button'.
  exceptionMessage=Cannot access a disposed object.
  Object name: 'Button'.
  exceptionDetails=System.ObjectDisposedException: Cannot access a disposed object.
  Object name: 'Button'.
     at System.Windows.Forms.Control.CreateHandle()
     at System.Windows.Forms.Control.get_Handle()
     at System.Windows.Forms.Control.PointToScreen(Point p)
     at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
     at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
     at System.Windows.Forms.Button.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  exceptionSource=System.Windows.Forms
  exceptionTargetSite=Void CreateHandle()
  </code></pre>
  
  <p>It looks like a mouse event is arriving at a form after the form has been disposed.</p>
  
  <p>Note there is none of my code in this stack trace.</p>
  
  <p>The only weird (?) thing I'm doing, is that I do tend to Dispose() Forms quite aggressively when I use them with ShowModal() (see "Aside" below).</p>
  
  <p><strong>EDIT:</strong> Just to clarify, I'm using C++-CLI so actually I don't call Dispose() I use the delete operator. This is the same as calling Dispose(), however.</p>
  
  <p>But I only do this after ShowModal() has returned (that should be safe right?), and only when I'm done with the form.</p>
  
  <p>I think I read that events might be queued up in the event queue, but I can't believe this would be the problem. I mean surely the framework must be tolerant to old messages? I can well imagine that under stress messages might back-log and surely the window might go away at any time?</p>
  
  <p>Any ideas?</p>
  
  <p>If you could even suggest ways of reproducing, that might be useful.</p>
  
  <p>John</p>
  
  <hr>
  
  <p>Aside:</p>
  
  <p>TBH I've never quite understood whether calling Dispose() after Form.ShowDialog() is strictly necessary - the MSDN docs for ShowDialog() are to my mind a bit ambiguous.</p>