共用方式為


RowDefinitionCollection.Add(RowDefinition) 方法

定義

RowDefinition 項目加入至 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

實作

範例

下列範例示範如何使用 Add 方法將 新增 RowDefinitionRowDefinitionCollection

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 運算元據行和資料列

適用於

另請參閱