private void BtnGenerate_Click(object sender, EventArgs e) { ComboBox1.ResetText(); ComboBox1.Items.Clear(); Random r = new Random(); for (int i = 0; i < r.Next(1, 500) - 1; i++) { ComboBox2.Items.Add(r.Next(100, 999)); } }