編輯

共用方式為


TextSearch.TextPath Attached Property

Definition

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

see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath
see GetTextPath, and SetTextPath

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

Remarks

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.

Dependency Property Information

Identifier field TextPathProperty
Metadata properties set to true None

Applies to

See also