title: DesignSurface: Can't delete controls
body: <p>I'm currently working on a project involving DesignSurfaces.</p>
  
  <p>In the Form_load event, I load a form with 3 textboxes, 3 labels and a button.
  To manage these controls, I have a ContextMenuStrip with MenuItems containing the <code>StandardCommands</code> Cut, Copy, Paste and Delete.
  However, when I try any of these actions, It'll throw an <code>InvalidOperationException</code> which says something like "The inherited component 'textBox1' cannot be deleted" (Unfortunately, I don't have the exception message in english, but through googling I found that it might be this one: "Cannot remove or destroy inherited component")
  If I add a control runtime and try to delete it, everything works fine (Cut, Copy, Paste too).</p>
  
  <p>Here's the code for the ContextMenuStrip:</p>
  
  <pre><code>public void ShowContextMenu( CommandID menuID, int x, int y ) {
              ContextMenu contextMenu = new ContextMenu();
  
              MenuCommand command = FindCommand( StandardCommands.Cut );
              if( command != null ) {
                  MenuItem menuItem = new MenuItem( "Cut", new EventHandler( OnMenuClicked ) );
                  menuItem.Tag = command;
                  contextMenu.MenuItems.Add( menuItem );
              }
              command = FindCommand( StandardCommands.Copy );
              if( command != null ) {
                  MenuItem menuItem = new MenuItem( "Copy", new EventHandler( OnMenuClicked ) );
                  menuItem.Tag = command;
                  contextMenu.MenuItems.Add( menuItem );
              }
              command = FindCommand( StandardCommands.Paste );
              if( command != null ) {
                  MenuItem menuItem = new MenuItem( "Paste", new EventHandler( OnMenuClicked ) );
                  menuItem.Tag = command;
                  contextMenu.MenuItems.Add( menuItem );
              }
              command = FindCommand( StandardCommands.Delete );
              if( command != null ) {
                  MenuItem menuItem = new MenuItem( "Delete", new EventHandler( OnMenuClicked ) );
                  menuItem.Tag = command;
                  contextMenu.MenuItems.Add( menuItem );
              }
  
              DesignSurface surface = (DesignSurface) _serviceProvider;
              Control viewService = (Control) surface.View;
  
              if( viewService != null ) {
                  contextMenu.Show( viewService, viewService.PointToClient( new Point( x, y ) ) );
              }
          }
  
  
  private void OnMenuClicked( object sender, EventArgs e ) {
              MenuItem menuItem = sender as MenuItem;
              if( menuItem != null &amp;&amp; menuItem.Tag is MenuCommand ) {
                  MenuCommand command = menuItem.Tag as MenuCommand;
                  command.Invoke();
              }
          }
  </code></pre>
  
  <p>I can't figure out what the problem is here.</p>
  
  <p>Did someone here experience a similiar issue? Or any ideas on how to solve this?</p>