Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ComboBox.StaysOpenOnEdit Property

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

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public bool StaysOpenOnEdit { get; set; }
/** @property */
public boolean get_StaysOpenOnEdit ()

/** @property */
public void set_StaysOpenOnEdit (boolean value)

public function get StaysOpenOnEdit () : boolean

public function set StaysOpenOnEdit (value : boolean)

<object StaysOpenOnEdit="bool" .../>

Property Value

A Boolean value, the default value is false.

Identifier Field

StaysOpenOnEditProperty

Metadata Flags

None

Setting this property to true will keep the drop-down control open when the user clicks on the text area to start editing.

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.

<ComboBox Name="cb" Margin="10,10,3,3" Width="200" Height="30" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" 
             IsEditable="true" Text="Open Combo Box" IsReadOnly="true" 
             StaysOpenOnEdit="true" IsDropDownOpen="true">
        <ComboBoxItem>Spain - Item 0</ComboBoxItem>
        <ComboBoxItem>France - Item 1</ComboBoxItem>
        <ComboBoxItem>Peru - Item 2</ComboBoxItem>
        <ComboBoxItem>Mexico - Item 3</ComboBoxItem>
</ComboBox>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft