MaskedTextProvider.ResetOnPrompt 屬性

定義

取得或設定值,判斷應如何處理符合提示字元的輸入字元。

public:
 property bool ResetOnPrompt { bool get(); void set(bool value); };
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 提示字元無效,而且嘗試新增字元的方法將會失敗。

適用於

另請參閱