You must Sign In to post a response.
  • Category: Windows

    Need to bind dynamically check box list in Windows form

    Hello ,

    I have requiremnt that , I need to read Config file and values needs to bind check box list in Windows form
    could any one please send me the code

    thanks
    Praveen
  • #761313
    Hello Praveen,

    Refer the below code :

    using System.IO;

    private void Form1_Load(object sender, EventArgs e)
    {
    StreamReader sr = new StreamReader("D:\\Test.txt");
    int lines = File.ReadAllLines("D:\\Test.txt").Length;
    if (lines > 0)
    {
    for (int i = 0; i < lines; i++)
    {
    checkedListBox1.Items.Add(sr.ReadLine());
    }
    sr.Close();
    }
    }

    Find the attached file, it's an output of this code.

    Hope this will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

    Delete Attachment


Sign In to post your comments