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

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

      2. 将列表框绑定到列表&lt;对象&gt;在 WinForms 中

        Binding Listbox to Listlt;objectgt; in WinForms(将列表框绑定到列表lt;对象gt;在 WinForms 中)
        <legend id='9omcr'><style id='9omcr'><dir id='9omcr'><q id='9omcr'></q></dir></style></legend>
          <tbody id='9omcr'></tbody>
          • <bdo id='9omcr'></bdo><ul id='9omcr'></ul>

            • <tfoot id='9omcr'></tfoot>

              <small id='9omcr'></small><noframes id='9omcr'>

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

                1. 本文介绍了将列表框绑定到列表&lt;对象&gt;在 WinForms 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  将列表框绑定到 Windows 窗体中的对象列表的最简单方法是什么?

                  What's the simplest way to bind a Listbox to a List of objects in Windows Forms?

                  推荐答案

                  您正在寻找 数据源属性:

                  You're looking for the DataSource property:

                  List<SomeType> someList = ...;
                  myListBox.DataSource = someList;
                  

                  您还应该将 DisplayMember 属性设置为您希望列表框显示的对象中的属性名称.如果不这样做,它将调用 ToString().

                  You should also set the DisplayMember property to the name of a property in the object that you want the listbox to display. If you don't, it will call ToString().

                  这篇关于将列表框绑定到列表&lt;对象&gt;在 WinForms 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Populate ListBox with a IEnumrable on another thread (winforms)(在另一个线程(winforms)上使用 IEnumrable 填充 ListBox)
                  listbox selected item give me quot; System.Data.DataRowViewquot; , C# winforms(列表框选择的项目给我quot;System.Data.DataRowView, C# Winforms)
                  Cannot remove items from ListBox(无法从列表框中删除项目)
                  Preventing ListBox scrolling to top when updated(更新时防止列表框滚动到顶部)
                  Drag and drop from list to canvas on windows phone with MVVM(使用 MVVM 在 Windows 手机上从列表拖放到画布)
                  Deselection on a WPF listbox with extended selection mode(具有扩展选择模式的 WPF 列表框上的取消选择)

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

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