Rabu, 06 Maret 2013

checkedListBox

penjelasan kode lebih lengkap klik disini

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace chekedlistbox
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        /// <summary>
        /// otomatis muncul kode dibawah ini
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void autorun(object sender, ItemCheckEventArgs e)
        {
           //nanti semua kode akan ditulis disini

            //e.NewValue adalah untuk memeriksa nilai baru entah dicentang atau tidak
            //checkState.Cheked maksunya adalah dicentang
            if (e.NewValue == CheckState.Checked)
            {
                string a = a + checkedListBox1.SelectedItem.ToString();
                textBox1.Text = a +"\n";
            }
        }
        //otomatis muncul kode diatas



    }
}

Tidak ada komentar:

Posting Komentar