CHECKLISTBOX IN C#

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
C# 
C#
 1431  View(s)
Ratings:
Rate this:
Hi Experts,

How can I add value in CheckListBox using C#?

Thanks in advance.


  1. Vijay Shukla

    Post:100

    Points:700
    Re: CheckListBox in C#

    Hi Ankita,


    You can use the following code:

    using System;

    using System.Drawing;

    using System.Windows.Forms;

    namespace WindowsFormsApplication1

    {

        public partial class Form1 : Form

        {

            public Form1()

            {

                InitializeComponent();

            }

            private void Form1_Load(object sender, EventArgs e)

            {

                checkedListBox1.Items.Add("Sunday"CheckState.Checked);

                checkedListBox1.Items.Add("Monday"CheckState.Unchecked);

                checkedListBox1.Items.Add("Tuesday"CheckState.Indeterminate);

                checkedListBox1.Items.Add("Wednesday"CheckState.Checked);

                checkedListBox1.Items.Add("Thursday"CheckState.Unchecked);

                checkedListBox1.Items.Add("Friday"CheckState.Indeterminate);

                checkedListBox1.Items.Add("Saturday"CheckState.Indeterminate);

            }

        }

    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!