为checkedListBox赋值并 遍历checkedListBox中选中的值

//赋值

 CLBDJZLS.Items.Clear();
            DataTable dtdjzl = Service.getTableBySql("SELECT * from talbe");
            foreach (DataRow dr in dtdjzl.Rows)
            {
                CLBDJZLS.Items.Add(dr["登记种类"].ToString());
            }

//遍历

for(int i=0;i<CLBDJZLS.Items.Count;i++)
{
        if (CLBDJZLS.GetItemChecked(i))
        {
          string value=CLBDJZLS.GetItemText(CLBDJZLS.Items[i]);
        }
}

你可能感兴趣的:(checked)