共用方式為


DataGridView.Delete Method

Definition

Deletes a dynamically created DataGridView from the worksheet and removes it from the ControlCollection.

public:
 System::Object ^ Delete();
public object Delete ();
member this.Delete : unit -> obj
Public Function Delete () As Object

Returns

Examples

For a code example that demonstrates how to use this method, see Microsoft.Office.Tools.Excel.Controls.Button.Delete. All controls in the Microsoft.Office.Tools.Excel.Controls namespace have a functionally equivalent Delete method.

Remarks

This method should only be used with a DataGridView that is created programmatically at run time. An exception is thrown if you call this method on a DataGridView that is added to the worksheet at design time.

Applies to