コード例 #1
0
        private void CategoriePreferata_Load(object sender, EventArgs e)
        {
            listView2.Items.Clear();
            closeToolStripMenuItem.ShortcutKeys            = Keys.Control | Keys.Space;
            inchideAplicatiaToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Escape;

            try
            {
                categorii = Categorie.getAllCategories(connString);
                foreach (Categorie categorie in categorii)
                {
                    ListViewItem itm = new ListViewItem(categorie.Id.ToString());
                    itm.SubItems.Add(categorie.Denumire);
                    listView2.Items.Add(itm);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }