ComboBox.StaysOpenOnEdit Property

Definition

Gets or sets whether a ComboBox that is open and displays a drop-down control will remain open when a user clicks the TextBox.

C#
public bool StaysOpenOnEdit { get; set; }

Property Value

true to keep the drop-down control open when the user clicks on the text area to start editing; otherwise, false. The default is false.

Examples

This example shows how to use the StaysOpenOnEdit property to create a combo box whose drop-down control stays open while the user enters information into the text box.

XAML
<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>

Remarks

Dependency Property Information

Item Value
Identifier field StaysOpenOnEditProperty
Metadata properties set to true None

Applies to

Produto Versões
.NET Framework 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
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10