using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace Checked_listbox{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void GetItem_Click(object sender, EventArgs e) { listBoxItem.Items.Clear(); foreach (string s in checkedListBox1.CheckedItems) listBoxItem.Items.Add(s); } private void GetIndex_Click(object sender, EventArgs e) { listBoxIndex.Items.Clear(); for (int i=0; i< checkedListBox1.CheckedIndices.Count; i++) listBoxIndex.Items.Add(checkedListBox1.CheckedIndices[i]); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ listBoxItem2.Items.Add(comboBox1.SelectedItem); } private void delete_Click(object sender, EventArgs e) { listBoxItem2.Items.Clear(); } }}