TextSearch.Text TextSearch.Text TextSearch.Text Attached Property

Definition

Gets or sets the string that identifies an item in a control's collection.

see GetText, and SetText
see GetText, and SetText
see GetText, and SetText

Examples

The following example creates a ComboBox that contains images as items instead of text. The IsEditable property is set to true, so text is displayed when one of the images is selected.

<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"/>
</ComboBox>

Remarks

This property specifies the text to displayed when an item is selected, and enables the user to select an item by typing the value of this property. As soon as the user types enough of the value to distinguish the item from other items in the selection, the item will be selected. Use this property on an item in a collection.

Dependency Property Information

Identifier field TextProperty
Metadata properties set to true BindsTwoWayByDefault

Applies to

See also