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

        <small id='7bMJT'></small><noframes id='7bMJT'>

        <tfoot id='7bMJT'></tfoot>

      1. ListBox.ItemsSource 的显示属性

        时间:2023-10-07

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

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

                <legend id='Pw8O7'><style id='Pw8O7'><dir id='Pw8O7'><q id='Pw8O7'></q></dir></style></legend>
                • <bdo id='Pw8O7'></bdo><ul id='Pw8O7'></ul>
                  本文介绍了ListBox.ItemsSource 的显示属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 WPF 新手.我有一个 ListBox,它的 ItemSource 设置为 WorkItemCollection.( 的集合WorkItem 对象.)

                  I am new to WPF. I have a ListBox that has its ItemSource set to a instance of WorkItemCollection. (A collection of WorkItem objects.)

                  显示列表时,它仅显示每个对象的类型 (Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem).有没有办法让列表显示 WorkItem.Title?

                  When the list is displayed it only displays the type of each object (Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem). Is there a way to make the list display WorkItem.Title?

                  推荐答案

                  你有两个选择.

                  最简单的方法是设置 DisplayMemberPath 将 ListBox 的属性设置为Title".

                  The simplest method is to set the DisplayMemberPath property of your ListBox to "Title".

                  如果您不仅想设置显示的内容,还想设置用于显示它的控件类型,那么您可以设置 ListBox 的 ItemTemplate.

                  If you want to set not only what gets displayed, but the type of control that is used to display it, then you would set the ListBox's ItemTemplate.

                  对于您的目标,我会推荐第一个选项.

                  For what your goal is, I would recommend the first option.

                  这篇关于ListBox.ItemsSource 的显示属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将图像添加到 System.Windows.Forms.ListBox? 下一篇:WinForms ListBox 控件上的多行列表项?

                  相关文章

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

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

                      <legend id='Rhcgw'><style id='Rhcgw'><dir id='Rhcgw'><q id='Rhcgw'></q></dir></style></legend>
                        <bdo id='Rhcgw'></bdo><ul id='Rhcgw'></ul>