Пример #1
0
        /// <summary>
        /// Remove a region to the listView
        /// </summary>
        private void buttonAdd_Click(object sender, System.EventArgs e)
        {
            if (listViewRegions.SelectedItems.Count > 0)
            {
                string newRegion = languageInfo.AddRegion();
                listViewRegions.Items.Add(newRegion);

                // Find the new item
                foreach (ListViewItem item in listViewRegions.Items)
                {
                    if (item.Text == newRegion)
                    {                     // and select it
                        item.Selected = true;
                        break;
                    }
                }
            }
        }