• <i id='esz85'><tr id='esz85'><dt id='esz85'><q id='esz85'><span id='esz85'><b id='esz85'><form id='esz85'><ins id='esz85'></ins><ul id='esz85'></ul><sub id='esz85'></sub></form><legend id='esz85'></legend><bdo id='esz85'><pre id='esz85'><center id='esz85'></center></pre></bdo></b><th id='esz85'></th></span></q></dt></tr></i><div id='esz85'><tfoot id='esz85'></tfoot><dl id='esz85'><fieldset id='esz85'></fieldset></dl></div>

  • <tfoot id='esz85'></tfoot>

    <small id='esz85'></small><noframes id='esz85'>

        <bdo id='esz85'></bdo><ul id='esz85'></ul>
      1. <legend id='esz85'><style id='esz85'><dir id='esz85'><q id='esz85'></q></dir></style></legend>
      2. 如何通过键入在 WPF ListBox 中找到项目?

        How can I find an item in a WPF ListBox by typing?(如何通过键入在 WPF ListBox 中找到项目?)
        <legend id='T4vlt'><style id='T4vlt'><dir id='T4vlt'><q id='T4vlt'></q></dir></style></legend>

          <small id='T4vlt'></small><noframes id='T4vlt'>

            <i id='T4vlt'><tr id='T4vlt'><dt id='T4vlt'><q id='T4vlt'><span id='T4vlt'><b id='T4vlt'><form id='T4vlt'><ins id='T4vlt'></ins><ul id='T4vlt'></ul><sub id='T4vlt'></sub></form><legend id='T4vlt'></legend><bdo id='T4vlt'><pre id='T4vlt'><center id='T4vlt'></center></pre></bdo></b><th id='T4vlt'></th></span></q></dt></tr></i><div id='T4vlt'><tfoot id='T4vlt'></tfoot><dl id='T4vlt'><fieldset id='T4vlt'></fieldset></dl></div>

              <tbody id='T4vlt'></tbody>

          • <tfoot id='T4vlt'></tfoot>
                <bdo id='T4vlt'></bdo><ul id='T4vlt'></ul>
                1. 本文介绍了如何通过键入在 WPF ListBox 中找到项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  大多数列表框允许您通过键入显示文本的首字母来查找其中的项目.如果键入的字母匹配多个项目,则可以继续添加字母以缩小搜索范围.

                  Most list boxes allow you to find items within them by typing the first letters of the displayed text. If the typed letters match multiple items, then you can keep adding letters to narrow the search.

                  我需要在 WPF ListBox 中执行此操作.但是,这些项目不是纯字符串——它们是我使用 DataTemplate 呈现的自定义对象.我希望有一种方法可以提供字符串值的路径,该路径应该用于 ListBox 项的文本键盘导航.

                  I need to do this in a WPF ListBox. However, the items aren't plain strings -- they're custom objects that I present using a DataTemplate. I'm hoping that there's a way I can provide a path to the string value that should be used for this textual keyboard navigation of the ListBox items.

                  这怎么可能?

                  推荐答案

                  您可以尝试将 IsTextSearchEnabled 设置为 true 并使用 TextSearch.TextPath 附加属性.

                  You could try setting IsTextSearchEnabled to true and using the TextSearch.TextPath attached property.

                  例如

                  <ListBox IsTextSearchEnabled="True" 
                           TextSearch.TextPath="CustomObject.StringProperty"/>
                  

                  这篇关于如何通过键入在 WPF ListBox 中找到项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                  CreateDelegate with unknown types(具有未知类型的 CreateDelegate)
                  Does Funclt;Tgt;.BeginInvoke use the ThreadPool?(Funclt;Tgt;.BeginInvoke 使用线程池吗?)
                  How to create a delegate to an instance method with a null target?(如何为具有空目标的实例方法创建委托?)

                      <tbody id='X2FK7'></tbody>

                          <bdo id='X2FK7'></bdo><ul id='X2FK7'></ul>
                        • <legend id='X2FK7'><style id='X2FK7'><dir id='X2FK7'><q id='X2FK7'></q></dir></style></legend>
                        • <tfoot id='X2FK7'></tfoot>

                        • <i id='X2FK7'><tr id='X2FK7'><dt id='X2FK7'><q id='X2FK7'><span id='X2FK7'><b id='X2FK7'><form id='X2FK7'><ins id='X2FK7'></ins><ul id='X2FK7'></ul><sub id='X2FK7'></sub></form><legend id='X2FK7'></legend><bdo id='X2FK7'><pre id='X2FK7'><center id='X2FK7'></center></pre></bdo></b><th id='X2FK7'></th></span></q></dt></tr></i><div id='X2FK7'><tfoot id='X2FK7'></tfoot><dl id='X2FK7'><fieldset id='X2FK7'></fieldset></dl></div>
                        • <small id='X2FK7'></small><noframes id='X2FK7'>