zoukankan      html  css  js  c++  java
  • C#中获取CheckListBox选中项的值

            /// <summary>
            /// C#中获取CheckListBox选中项的值。
            /// </summary>
            /// <param name="clb">要被获取选中项的CheckListBox类型的对象。</param>
            /// <returns>返回一个ArrayList类型的对象。</returns>
            private ArrayList GetCheckedItemsText(CheckedListBox clb)
            {
                ArrayList result = new ArrayList();
                IEnumerator myEnumerator = clb.CheckedIndices.GetEnumerator();
                int index;

                while (myEnumerator.MoveNext())
                {
                    index = (int)myEnumerator.Current;
                    clb.SelectedItem = clb.Items[index];
                    result.Add(clb.Text);
                }
                return result;
            }

  • 相关阅读:
    IO之同步、异步、阻塞、非阻塞 (2)
    IO之同步、异步、阻塞、非阻塞
    Syncthing源码解析
    Syncthing源码解析
    在Gogland里对GO程序进行单元测试!
    GO学习笔记
    GO学习笔记
    GO学习笔记
    GO学习笔记
    GO学习笔记
  • 原文地址:https://www.cnblogs.com/bison1989/p/1979351.html
Copyright © 2011-2022 走看看