title: checking whether a CheckedListBox is empty
body: <p>I have a small form in which the user writes the name of some item, and then when he clicks "Add" there is a statement that needs to check if there is already the same item in the checkedListBox.</p>
  
  <p>I'm looking for the "if" statment that checked if the list is empty or with some item.</p>
  
  <pre><code>private void button2_Click(object sender, EventArgs e)
  {
      foreach (var item in checkedListBox1.Items)
      {
          if (itemName.Text == item.ToString())
          {
              DialogResult result = MessageBox.Show("?", "Question", MessageBoxButtons.YesNoCancel);
              if (result == DialogResult.Yes)
              {
                  checkedListBox1.Items.Add(itemName.Text);
              }
              else if (result == DialogResult.No)
              {
                  //clear the forms
              }
          }
          else
          {
              checkedListBox1.Items.Add(itemName.Text);
              timeLeft = 2;
              timer1.Start();
          }
      }
  }
          //checkedListBox1.Items.Add(itemName.Text);
          //timeLeft = 2;
          //timer1.Start();
  </code></pre>