Sanu

Sanu

  • NA
  • 33
  • 49.9k

Whic code is more correct?

Oct 22 2012 8:57 AM
Hi

I've 10 combo boxes in a form. Want to populate all cmbbxes with values - numbers from 1 to 10. Is this code ok or do u suggest ny othr code?

public void BindCombos()
        {
            for (int i = 1; i <= 10; i++)
            {
                cmbDependability.Items.Add(i);
                cmbAdaptability.Items.Add(i);
                cmbAppearance.Items.Add(i);
                cmbInitiative.Items.Add(i);
                cmbResponsibility.Items.Add(i);
                cmbQualityOfWork.Items.Add(i);
                cmbAttitude.Items.Add(i);
                cmbQuantityOfWork.Items.Add(i);
                cmbAttendance.Items.Add(i);
                cmbJobKnowledge.Items.Add(i);
            }
        }

        private void Performance_Load(object sender, EventArgs e)
        {
            BindCombos();
        }






Answers (10)