IValueProvider.IsReadOnly 屬性

定義

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

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

屬性值

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

範例

下列範例示範控制項的這個方法實作,允許變更其值。

/// <summary>
/// Specifies whether the custom control is read only.
/// </summary>
bool IValueProvider.IsReadOnly
{
    get
    {
        return false;
    }
}
''' <summary>
''' Specifies whether the custom control is read only.
''' </summary>
Private ReadOnly Property IsReadOnly() As Boolean Implements IValueProvider.IsReadOnly
    Get
        Return False
    End Get
End Property

備註

控制項的 IsEnabledProperty 應該設為 trueIsReadOnlyProperty 應該設為 false ,才能允許呼叫 SetValue

適用於