Share via


HierarchyInfo.Delete Method

Definition

Deletes the node from the hierarchy.

public:
 bool Delete();
public bool Delete ();
member this.Delete : unit -> bool
Public Function Delete () As Boolean

Returns

true if the node is successfully removed; otherwise, false.

Examples

The following example deletes the node. The example displays a message if the node is not deleted.

bool DemoInternalDelete()
{
    bool b = Delete();
    if (b != true)
        MessageBox.Show("Unable to delete " + NodeTypeName);
    return b;
}

Remarks

If the System.ComponentModel.CancelEventArgs.Cancel property is set to false in the OnDeleting method, the Delete method will be canceled. System.ComponentModel.CancelEventArgs.Cancel must be set to true for the calling class to delete the node.

Applies to