IValueProvider.IsReadOnly Egenskap

Definition

Hämtar ett värde som anger om värdet för en kontroll är skrivskyddat.

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

Egenskapsvärde

true om värdet är skrivskyddat. false om den kan ändras.

Exempel

I följande exempel visas en implementering av den här metoden för en kontroll som gör att dess värde kan ändras.

/// <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

Kommentarer

En kontroll bör ha sin IsEnabledProperty inställd på true och dess IsReadOnlyProperty inställd på false innan ett anrop tillåts till SetValue.

Gäller för