Share via


IValueProvider.Value 屬性

定義

取得控制項的值。

public:
 property System::String ^ Value { System::String ^ get(); };
public string Value { get; }
member this.Value : string
Public ReadOnly Property Value As String

屬性值

控制項的值,以字串表示。

範例

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

/// <summary>
/// Retrieves the value of the custom control.
/// </summary>
string IValueProvider.Value
{
    get
    {
        return controlValue;
    }
}
''' <summary>
''' Retrieves the value of the custom control.
''' </summary>
Private ReadOnly Property Value() As String Implements IValueProvider.Value
    Get
        Return controlValue
    End Get
End Property

備註

除了實作 () 之外,單行編輯控制項還 ITextProvider 支援以程式設計方式存取其內容 IValueProvider 。 不過,多行編輯控制項不會實作 IValueProvider

若要擷取多行編輯控制項的文字內容,控制項必須實 ITextProvider 作 。 不過, ITextProvider 不支援設定控制項的值。

IValueProvider 不支援擷取格式設定資訊或子字串值。 在這些案例中請實作 ITextProvider

適用於