很多人可能想不到是遍历ListItem li in chkBoxPro.Items这里的Items
foreach (ListItem li in chkBoxPro.Items)
{
    
if (li.Value == arrList[i])
        li.Selected 
= true;
}
private string getTotal()
{
    
int totalNum = 0;
    
for (int i = 0; i < chkBoxPro.Items.Count; i++)
    {
        
if (chkBoxPro.Items[i].Selected)
        {
            totalNum 
+= 1;
        }
    }
    
return totalNum.ToString();
}

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2022-01-24
  • 2021-05-22
  • 2021-06-24
  • 2022-01-02
  • 2021-09-07
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2023-03-18
  • 2022-01-23
  • 2022-12-23
相关资源
相似解决方案