• <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中获取多个选定项目?

        时间:2023-10-06

          • <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中获取多个选定项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将用户控件添加为列表框项 下一篇:在 Windows Phone 上实现可滚动表

                  相关文章

                    <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>

                  1. <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'>