RowDefinitionCollection.IsReadOnly 属性

定义

获取一个值,该值指示 RowDefinitionCollection 是否为只读。

public:
 property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean

属性值

如果该集合为只读,则为 true;否则为 false。 此属性没有默认值。

实现

示例

以下示例演示如何获取 属性的值 IsReadOnly

private void colReadOnly(object sender, RoutedEventArgs e)
{
    tp4.Text = "RowDefinitionsCollection IsReadOnly?: " + grid1.RowDefinitions.IsReadOnly.ToString();
    tp5.Text = "ColumnDefinitionsCollection IsReadOnly?: " + grid1.ColumnDefinitions.IsReadOnly.ToString();
}
Private Sub colReadOnly(ByVal sender As Object, ByVal e As RoutedEventArgs)
    tp4.Text = "RowDefinitionsCollection IsReadOnly?: " + grid1.RowDefinitions.IsReadOnly.ToString()
    tp5.Text = "ColumnDefinitionsCollection IsReadOnly?: " + grid1.ColumnDefinitions.IsReadOnly.ToString()
End Sub

若要查看完整示例,请参阅 如何:使用 ColumnDefinitionsCollections 和 RowDefinitionsCollections 操作列和行。

适用于

另请参阅