Esempio n. 1
0
        private void tsmiAddGroup_Click(object sender, EventArgs e)
        {
            var lv = GetListViewFromToolStripDropDownItem(sender);

            using (var frm = new frmGroup())
            {
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                var item = new ListViewItem(frm.GroupValue)
                               {
                                   Tag = frm.GroupValue
                               };

                lv.Items.Add(item);
            }
        }
Esempio n. 2
0
        private void tsmiEditGroup_Click(object sender, EventArgs e)
        {
            var lv = GetListViewFromToolStripDropDownItem(sender);

            if (lv.SelectedItems.Count != 1)
            {
                return;
            }

            var item = lv.SelectedItems[0];

            using (var frm = new frmGroup(item.Tag.ToString()))
            {
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                item.Tag = frm.GroupValue;

                item.SubItems[0].Text = frm.GroupValue;
            }
        }