1. 程式人生 > >checkedListBox獲取選擇的值

checkedListBox獲取選擇的值

            string print = "";

            for (int i = 0; i < checkedListBox1.Items.Count; i++)
            {
                if(checkedListBox1.GetItemChecked(i))
                {
                    checkedListBox1.SetSelected(i, true);
                    print += checkedListBox1.SelectedValue.ToString() + ";";
                }
            }
            MessageBox.Show(print);