共用方式為


IRangeValueProvider.IsReadOnly 屬性

定義

取得值,指定控制項的值是否為唯讀。

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

屬性值

Boolean

如果此值為唯讀,則為 true;如果可以修改,則為 false

範例

下列範例顯示非唯讀控制項的這個方法實作。

/// <summary>
/// Specifies whether the control is read-only.
/// </summary>
public bool IsReadOnly
{
    get 
    { 
        return !(this.customControl.Enabled); 
    }
}
''' <summary>
''' Specifies whether the control is read-only.
''' </summary>
Public ReadOnly Property IsReadOnly() As Boolean Implements IRangeValueProvider.IsReadOnly
    Get
        Return Not(Me.customControl.Enabled)
    End Get
End Property

適用於

另請參閱