Checkedlistbox uncheck all

From Logic Wiki
Jump to: navigation, search


as an extension method we can add this to our project.

namespace Gokis.Extensions
{
    public static class AppExtensions
    {
        public static void UncheckAllItems(this System.Windows.Forms.CheckedListBox clb)
        {
            while (clb.CheckedIndices.Count > 0)
                clb.SetItemChecked(clb.CheckedIndices[0], false);
        }
    }
}