Click here to Skip to main content
13,295,178 members (66,755 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 8 Nov 2007

CheckListBox Based on ListBox that Supports ReadOnly

, 8 Nov 2007
Rate this:
Please Sign up or sign in to vote.
Extended ListBox which supports CheckBox in Normal and ReadOnly mode
Screenshot - CheckListBox_demo.jpg


This is based on this article where I extended the code provided by Zhi-Xin Ye in the post to create a CheckListBox that supports ReadOnly unlike CheckedListBox control which can only be disabled.

Using the Code

The demo project contains the code as follows:

private void Form1_Load(object sender, EventArgs e)
    //ReadOnly CheckListBox
    checkListBox1.BackColor = Color.FromKnownColor(KnownColor.ControlLight);
    checkListBox1.SelectionMode = SelectionMode.None;
    CheckBox[] boxes = new CheckBox[100];
    for (int i = 0; i < 100; i++)
        CheckBox box = new CheckBox();
        box.Checked = true;
        box.Enabled = false;
        box.Text = "box" + i.ToString();
        boxes[i] = box;
    //Normal CheckListBox
    boxes = new CheckBox[100];
    for (int i = 0; i < 100; i++)
        CheckBox box = new CheckBox();
        box.Text = "box" + i.ToString();
        boxes[i] = box;

Points of Interest

Like I mentioned, mouse wheel scroll is quite slow and there's flickering when I use scrollbar. This is just a start. Hopefully I will be able to make it better in future.


  • 1.0 Created


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

H. Tony
Software Developer (Senior)
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralThe real solution Pin
H. Tony28-Jan-08 6:40
memberH. Tony28-Jan-08 6:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 8 Nov 2007
Article Copyright 2007 by H. Tony
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid