ComboBox.StaysOpenOnEdit 屬性

定義

取得或設定值,這個值表示當使用者按一下 ComboBox 時,已開啟並顯示下拉式清單控制項的 TextBox 是否會保持開啟狀態。

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

屬性值

Boolean

true 表示當使用者按下文字區域開始編輯時,保持下拉式清單控制項開啟,否則為 false。 預設為 false

範例

這個範例示範如何使用 StaysOpenOnEdit 屬性來建立下拉式方塊,當使用者在文字方塊中輸入資訊時,下拉式方塊會保持開啟狀態。

<ComboBox Name="cb" Margin="10,10,3,3" Width="200" Height="30" Grid.Column="0" Grid.Row="2"         
          ItemsSource="{StaticResource myCities}" Text="My Cities"
          IsEditable="true"  IsReadOnly="true" 
          IsDropDownOpen="True" StaysOpenOnEdit="True">
</ComboBox>

備註

相依性屬性資訊

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

適用於