ComboBox.ShouldPreserveUserEnteredPrefix 屬性

定義

取得或設定值,指出 ComboBox 是否會保留使用者的輸入,或者用符合的項目取代輸入。

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

屬性值

Boolean

如果 ComboBox 會保留使用者的輸入,則為 true,如果 ComboBox 用符合的項目取代輸入,則為 false。登錄預設值為 false。 如需可能會影響該值的相關詳細資訊,請參閱 相依性屬性值優先順序

備註

根據預設,當使用者在符合其中一個專案的 中輸入字串 ComboBox 時,會選取該專案,並取代使用者輸入的文字。 這可能會導致使用者輸入的文字變更大小寫。 ShouldPreserveUserEnteredPrefix如果 屬性設定 true 為 ,則會 ComboBox 選取相符的專案,但會保留使用者輸入的文字。 例如,假設 ComboBox 包含大寫 H) 的 「Hello」 (字串,而使用者輸入 「hello」 (並具有小寫 h) 。 如果 ShouldPreserveUserEnteredPrefixfalse ,則會 ComboBox 在其集合中選取相符的專案 「Hello」,並以該字串填入其文字方塊。 如果 ShouldPreserveUserEnteredPrefixtrue ,則會從集合中選取 「Hello」,但文字方塊會顯示 「hello」。

相依性屬性資訊

識別碼欄位 ShouldPreserveUserEnteredPrefixProperty
中繼資料屬性設定為 true

適用於