Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.


Gets or sets a value that enables or disables editing of the text in text box of the ComboBox. This is a  dependency property.

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

public bool IsEditable { get; set; }
/** @property */
public boolean get_IsEditable ()

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

public function get IsEditable () : boolean

public function set IsEditable (value : boolean)

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


true if the ComboBox can be edited; otherwise false. The default value is false.

The IsEditable property is used in conjunction with the IsReadOnly property to control the level to which the display text of the ComboBox is editable or selectable. Here, "selectable" refers to the ability to use the mouse or keyboard to highlight a portion of content for operations such as Copy or Cut, as opposed to selecting a particular item in the ComboBox.  Note that only display text represented by the Text property can be edited; contents of the underlying ComboBoxItem elements cannot be edited directly. The following table lists available configurations.



Resulting Configuration



Contents of the ComboBox are selectable but not editable.



Contents of the ComboBox are fully editable.


Does not matter

Contents of the ComboBox are not editable or selectable. This is thedefault configuration.

Because IsReadOnly has a default value of false, the value of IsEditable can be used to enable or disable full editing and selection of ComboBox contents.  The value of IsReadOnly is typically only changed to enable a configuration in which the contents of the ComboBox are selectable, but not editable.

When IsEditable is equal to false, the ComboBox uses a ContentPresenter to display the currently selected item; when IsEditable is equal to true, a TextBox is used for this purpose instead.  Note that a TextBox only displays plain text, and that a ComboBoxItem may include non-plain text content, such as images.  When IsEditable is equal to true and a selected ComboBoxItem includes non-plain text content, the ComboBox will display any TextSearch text for ComboBoxItem in lieu of the non-plain text content.

The following examples create ComboBox controls that contain images as items instead of text. If the IsEditable property is set to true nothing is displayed when one of the images is selected. To avoid a blank TextBox or a TextBox with unexpected text use the TextSearch properties, Text and TextPath to assign text to be displayed.

<ComboBox IsEditable="true" TextSearch.TextPath="Name">
      <Image Name="Cat" Source="data\cat.png"/>
      <Image Name="Dog" Source="data\dog.png"/>
      <Image Name="Fish" Source="data\fish.png"/>

<ComboBox IsEditable="true">
      <Image TextSearch.Text="Cat" Source="data\cat.png"/>
      <Image TextSearch.Text="Dog" Source="data\dog.png"/>
      <Image TextSearch.Text="Fish" Source="data\fish.png"/>

Another solution is to use the DisplayMemberPath property. The drop-down control of the ComboBox will not display the images but will display the text you assigned.

The following example shows how to use DisplayMemberPath.

<ComboBox IsEditable="true" DisplayMemberPath="Name">
      <Image Name="CAT" Source="data\cat.png"/>
      <Image Name="DOG" Source="data\dog.png"/>
      <Image Name="FISH" Source="data\fish.png"/>

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0