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

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

        <legend id='Pxoag'><style id='Pxoag'><dir id='Pxoag'><q id='Pxoag'></q></dir></style></legend>

        <tfoot id='Pxoag'></tfoot>

        如何在列表框wpf中获取多个选定项目?

        How to get multiple selected items in listbox wpf?(如何在列表框wpf中获取多个选定项目?)

          • <small id='vcWCq'></small><noframes id='vcWCq'>

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

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

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

                  本文介绍了如何在列表框wpf中获取多个选定项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对如何从 wpf 的列表框中检索多选值感到困惑.

                  I am confused on how to retrieve multi selected values from listbox in wpf.

                  在 XAML 中,我有以下带有多个选择模式的列表框.

                  In XAML I have the following listbox with selection mode multiple.

                   <ListBox Height="100" HorizontalAlignment="Left" Margin="139,207,0,0" Name="listBox1" VerticalAlignment="Top" Width="120" SelectionChanged="listBox1_SelectionChanged" SelectionMode="Multiple" />    
                  
                   <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="319,220,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
                  

                  我现在如何签入 foreach 循环?

                  How do I check in foreach loop now?

                          foreach (ListItem li in listBox1.Items)
                          {
                                  ?? // how to check li is selected or not
                          }
                  

                  推荐答案

                  您将在 ListBox.SelectedItems.

                  foreach (var item in listBox1.SelectedItems)
                  {
                  
                  }
                  

                  这篇关于如何在列表框wpf中获取多个选定项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 列表框上的取消选择)
                    <tbody id='yqkC4'></tbody>

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

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

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