Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3426310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:41:59+00:00 2026-05-18T06:41:59+00:00

I have a WPF Listbox control and I would like to allow the user

  • 0

I have a WPF Listbox control and I would like to allow the user to change the selected item by using type-ahead. The behavior I’m looking for is exactly like windows explorer. As you continue to type the text of a folder name, the list will keep selecting the more correct item.

For example assume this folder structure:

OtherFolderName
MyFirstFolder
MyFirstFileFolder
MyFirstList

If you select OtherFolderName with the mouse, then start typing MyFirstF the item MyFirstFolder will be selected, but if you continue typing MyFirstFi the item MyFirstFileFolder will be selected.

My WPF Listbox does not exhibit this behavor, I am hoping I can easily enable it, as the old WinForms listbox did just this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:42:00+00:00Added an answer on May 18, 2026 at 6:42 am

    Take a look at the TextSearch class, specifically the TextSearch.TextPath attached property:

    <ListBox TextSearch.TextPath="FolderName" ... />
    

    The TextSearch.TextPath property enables text searching and specifies how to extract the search text from each item. In this case I assumed each of your Folder objects has a property named “FolderName”.

    If this doesn’t do everything you’re looking for, you’ll probably have to implement your own search, since the TextSearch feature isn’t particularly tweakable. To do this:

    1. Handle the TextInput event
    2. Compare the time of the current TextInput with the prior TextInput. If close enough together, append to prefix string otherwise set it to the single character typed.
    3. Search all Items for the given prefix & if found set SelectedItem.

    I would build this as a separate class using an attached property, similar to the built-in TextSearch class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Each item in a WPF ListBox control seems to have a bit of left
I have a WPF ListBox that I would like to Enable multiple selection in
Using WPF, I have a ListBox control with a DataTemplate inside it. The relevant
I have a wpf user control which exposes an IEnumerable ItemsSource DependencyProperty. I bind
I have a ListBox control in WPF which contains items of variable height (predominantly
I have a listbox that in which every item is represented using a textbox.
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have a WPF ListBox bound to a data object. Inside the listbox are
I have a WPF listbox which displays messages. It contains an avatar on the
I have a WPF TabControl with two TabItems. Each TabItem contains a ListBox with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.