MaskedTextProvider.ResetOnPrompt 屬性
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,判斷應如何處理符合提示字元的輸入字元。
public:
property bool ResetOnPrompt { bool get(); void set(bool value); };
C#
public bool ResetOnPrompt { get; set; }
member this.ResetOnPrompt : bool with get, set
Public Property ResetOnPrompt As Boolean
true
表示輸入的提示字元會造成遮罩中目前的可編輯位置重設,而 false
則表示提示字元會當做一般輸入字元處理。 預設為 true
。
MaskedTextProvider 可以特殊方式處理兩種字元、步調和提示字元。 一般而言,每個輸入字元都會針對遮罩進行測試,並接受或拒絕。 根據PromptChar假設屬性設定為 以外的null
值,然後將 屬性設定為 true
,將 屬性設定ResetOnPrompt為 將會導致提示字元的特殊處理。 新增提示字元時,會導致清除目前的遮罩字元位置,並將目前位置進階到下一個可編輯的字元。
ResetOnPrompt 會優先於 AllowPromptAsInput 下表所述的屬性。
ResetOnPrompt | AllowPromptAsInput | 產生的行為 |
---|---|---|
true |
true |
您可以新增提示字元,並重設目前的遮罩位置。 預設值。 |
true |
false |
您可以新增提示字元,並重設目前的遮罩位置。 |
false |
true |
提示字元會處理為一般輸入字元。 |
false |
false |
提示字元無效,而且嘗試新增字元的方法將會失敗。 |
產品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |