ColumnDefinitionCollection.Clear ColumnDefinitionCollection.Clear ColumnDefinitionCollection.Clear ColumnDefinitionCollection.Clear Method

定義

清除 ColumnDefinitionCollection 的內容。Clears the content of the ColumnDefinitionCollection.

public:
 virtual void Clear();
public void Clear ();
abstract member Clear : unit -> unit
override this.Clear : unit -> unit
Public Sub Clear ()

實作

範例

下列範例示範如何使用Clear方法來清除的內容。 ColumnDefinitionCollectionThe following example demonstrates how to use the Clear method to clear the content of a ColumnDefinitionCollection.

private void clearCol(object sender, RoutedEventArgs e)
{
    grid1.ColumnDefinitions.Clear();
}
Private Sub clearCol(ByVal sender As Object, ByVal e As RoutedEventArgs)
    grid1.ColumnDefinitions.Clear()
End Sub

若要查看完整的範例, 請參閱如何:使用 ColumnDefinitionsCollections 和 Rowdefinitionscollections 管理資料運算元據行和資料列。To view the complete sample, see How to: Manipulate Columns and Rows by Using ColumnDefinitionsCollections and RowDefinitionsCollections.

適用於

另請參閱