Udostępnij za pośrednictwem


CannotRemoveControlException Class (2007 System)

The exception that is thrown when code tries to remove a host control or Windows Forms control that was added to a document at design time.

Namespace:  Microsoft.Office.Tools
Assembly:  Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)

Syntax

'Declaration
<SerializableAttribute> _
Public NotInheritable Class CannotRemoveControlException _
    Inherits RuntimeException
'Usage
Dim instance As CannotRemoveControlException
[SerializableAttribute]
public sealed class CannotRemoveControlException : RuntimeException
[SerializableAttribute]
public ref class CannotRemoveControlException sealed : public RuntimeException
public final class CannotRemoveControlException extends RuntimeException

Remarks

If you add host controls and Windows Forms controls to documents that are part of document-level customizations at design time, you cannot delete these controls at run time. For more information, see Host Items and Host Controls Overview.

This exception can be thrown by the Visual Studio Tools for Office runtime if you call one of the following methods to delete a control that was added at design time:

Inheritance Hierarchy

System.Object
  System.Exception
    Microsoft.VisualStudio.Tools.Applications.Runtime.RuntimeException
      Microsoft.Office.Tools.CannotRemoveControlException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CannotRemoveControlException Members

Microsoft.Office.Tools Namespace

Other Resources

Host Items and Host Controls Overview