RowDefinitionCollection.Add(RowDefinition) RowDefinitionCollection.Add(RowDefinition) RowDefinitionCollection.Add(RowDefinition) RowDefinitionCollection.Add(RowDefinition) Method

定義

RowDefinition 項目加入至 RowDefinitionCollectionAdds a RowDefinition element to a RowDefinitionCollection.

public:
 virtual void Add(System::Windows::Controls::RowDefinition ^ value);
public void Add (System.Windows.Controls.RowDefinition value);
abstract member Add : System.Windows.Controls.RowDefinition -> unit
override this.Add : System.Windows.Controls.RowDefinition -> unit
Public Sub Add (value As RowDefinition)

參數

value
RowDefinition RowDefinition RowDefinition RowDefinition

識別要加入至集合的 RowDefinitionIdentifies the RowDefinition to add to the collection.

實作

範例

下列範例示範如何使用Add方法, RowDefinition將加入至RowDefinitionCollectionThe following example demonstrates how to use the Add method to add a RowDefinition to a RowDefinitionCollection.

private void addRow(object sender, RoutedEventArgs e)
{
    rowDef1 = new RowDefinition();
    grid1.RowDefinitions.Add(rowDef1);
}
Private Sub addRow(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim rowDef1 As New RowDefinition()
    grid1.RowDefinitions.Add(rowDef1)
End Sub

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

適用於

另請參閱