MaskedTextBox.AllowPromptAsInput 屬性

定義

取得或設定值,指出使用者是否可以輸入 PromptChar 做為有效資料。

public:
 property bool AllowPromptAsInput { bool get(); void set(bool value); };
public bool AllowPromptAsInput { get; set; }
member this.AllowPromptAsInput : bool with get, set
Public Property AllowPromptAsInput As Boolean

屬性值

如果使用者可以將提示字元輸入到控制項中,則為 true,否則為 false。 預設為 true

備註

即使 AllowPromptAsInputtrue ,提示字元也必須對遮罩中的目前位置有效,才能接受。 例如,如果 PromptChar 為 「*」,且遮罩中的目前位置要求使用者輸入數位,則輸入星號 (*) 將會失敗,並導致 MaskInputRejected 事件發生。

屬性 ResetOnPrompt 的優先順序高於 AllowPromptAsInput

適用於

另請參閱