title: How to remove itself from its parent WITHOUT error in DesignMode
body: <p>I'm tried to make a control that will kill itself when added to a form.
  Actually what I want to do is make a control that will ask for password before added to a form, and remove itself if the password is wrong...
  Anything work great, it really will remove itself from the parent form, but it will show a error message too:
  "'child' is not a child control of this parent."</p>
  
  <p>Here the code:</p>
  
  <pre><code>Public Class SuicideCustomButton
      Inherits Button
  
      Protected Overrides Sub InitLayout()
          If DesignMode Then
              Me.Parent.Controls.Remove(Me)
              'ALWAYS SHOW ERROR HERE
          Else
              Me.Parent.Controls.Remove(Me)
              'NO ERROR SHOWED HERE
          End If
      End Sub
  End Class
  </code></pre>
  
  <p>How can I get rid of that error message? </p>