private void InitializeNewLetterMenu() { _letterTypes = ClientRequests.GetAllLetterTypes(); toolStripComboBox1.SelectedIndexChanged += new EventHandler(toolStripComboBox1_SelectedIndexChanged); toolStripComboBox1.Items.Clear(); foreach (LetterType letterType in _letterTypes) { toolStripComboBox1.Items.Add(letterType.Name); _comboLettersTypes.Add(letterType); } toolStripComboBox1.SelectedItem = 0; }
private void InitializeNewLetterMenu() { _letterTypes = (List <LetterType>)(ClientRequests.GetAllLetterTypes()); List <ToolStripMenuItem> items = new List <ToolStripMenuItem>(); compose.DropDown.Items.Clear(); int i = 0; foreach (LetterType letterType in _letterTypes) { items.Add(new ToolStripMenuItem(letterType.Name)); items[i].Click += new EventHandler(toolStripComboBox1_SelectedIndexChanged); ++i; } compose.DropDownItems.AddRange(items.ToArray()); }