C
CheckedListbox Kontrolü Kullanımı – 2
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 Checkedlstbox_1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { int toplam=checkedListBox1.Items.Count; for(int i=0;i<toplam;i++) { checkedListBox1.SetItemChecked(i, true); } label1.Text = toplam + " adet eleman seçildi."; } private void button2_Click(object sender, EventArgs e) { int toplam = checkedListBox1.Items.Count; for (int i = 0; i < toplam; i++) { checkedListBox1.SetItemChecked(i, false); } } private void button3_Click(object sender, EventArgs e) { for(int i=0;i<checkedListBox1.CheckedItems.Count;i++) { listBox1.Items.Add(checkedListBox1.CheckedItems[i]); } } private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e) { label1.Text = checkedListBox1.CheckedItems.Count + " eleman seçildi"; } } }