using System;
using System.Windows.Forms;

namespace TestFlatCombo
{
    public partial class MainForm : Form
    {
        private string[] comboItems;
        private ComboBox[] combos;

        public MainForm()
        {
            InitializeComponent();
            this.comboItems = new[]
            {
                "Angela Schulz",
                "Klaus Müller",
                "Heinz Meier",
                "Petra Maier",
                "Andreas Mayer",
                "Thomas Schmidt",
                "Michaela Schmied",
                "Michael Mair"
            };
            this.combos = new[] 
            { 
                this.defaultComboBoxStandard, this.defaultComboBoxSystem, this.defaultComboBoxFlat, this.defaultComboBoxPopup, 
                this.flatComboBoxStandard, this.flatComboBoxSystem, this.flatComboBoxFlat, this.flatComboBoxPopup 
            };
            foreach (var combo in this.combos)
            {
                combo.Items.AddRange(comboItems);
                combo.SelectedIndex = 0;
            }
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
        }

        private void enabledCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            foreach (var combo in this.combos)
                combo.Enabled = this.enabledCheckBox.Checked;
        }
    }
}
