Exemplo n.º 1
0
        private void addItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditorForm adder = new EditorForm("", "", false);
            adder.Location = this.Location;
            adder.ShowDialog();

            if (!adder.Canceled)
            {
                BetterListViewItem blvi = new BetterListViewItem();
                blvi.Text = adder.textLabelName.Text;
                blvi.SubItems.Add(adder.textLabelData.Text);
                itemView.Items.Add(blvi);
            }
        }
Exemplo n.º 2
0
 private void itemView_DoubleClick(object sender, EventArgs e)
 {
     if (itemView.SelectedItems.Count > 0)
     {
         BetterListViewItem cItem = itemView.SelectedItems[0];
         EditorForm editor = new EditorForm(cItem.Text, cItem.SubItems[1].Text);
         editor.Location = this.Location;
         editor.ShowDialog();
         if (!editor.Canceled)
         {
             string newName = editor.textLabelName.Text;
             cItem.Text = editor.textLabelName.Text;
             cItem.SubItems[1].Text = editor.textLabelData.Text;
         }
     }
 }