Export (0) Print
Expand All

TextSearch.Text Attached Property

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

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

See GetText, SetText
<object TextSearch.Text="string" .../>

Property Value

Type: System.String
The text that identifies the item to the user. The default value is an empty string.

Identifier field

TextProperty

Metadata properties set to true

BindsTwoWayByDefault

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.

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>

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft