Exemplo n.º 1
0
        private void excWordRC_Opening(object sender, CancelEventArgs e)
        {
            removeBRC.Enabled = false;

            var lv = (ListView)ContextMenuStripExtras.GetContextParent(removeBRC, typeof(ListView));

            if (lv == null)
            {
                return;
            }
            removeBRC.Enabled = lv.SelectedItems.Count != 0;
        }
Exemplo n.º 2
0
        private void removeBRC_Click(object sender, EventArgs e)
        {
            var lb = ContextMenuStripExtras.GetContextParent(removeBRC, typeof(ListView)) as ListView;

            if (lb == null)
            {
                return;
            }

            foreach (ListViewItem s in lb.SelectedItems)
            {
                lb.Items.RemoveByKey(s.Text);
            }
            RefreshCharts();
        }