TextPath Attached Property
Collapse the table of content
Expand the table of content

TextSearch.TextPath Attached Property


Gets or sets the name of the items' property that identifies each item in a control's collection.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

See GetTextPath, SetTextPath

Property Value

Type: System.String

The name of the property that contains the text that identifies the item to the user. The default value is an empty string.

Use this property on a control that contains a collection of items. The value of the specified property is the text that the user can type to select the item, and the text that is displayed if the control is set to display text in its TextBox. If you set the Text property on a control's collection item, the TextPath property will be ignored. If you set the TextPath property to a value that is not the name of an actual property, TextPath is ignored.

Identifier field


Metadata properties set to true


Legacy Code Example

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.

Code snippet is not found. Confirm that the code snippet name 'ComboBoxProps_snip' is correct.
Return to top
© 2015 Microsoft