Exemplo n.º 1
0
        private void AddItem()
        {
            AddListBoxItemForm dlg    = new AddListBoxItemForm();
            DialogResult       result = dlg.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                string newItem = dlg.NewItem;
                listBox.Items.Add(newItem);
            }
        }
Exemplo n.º 2
0
 private void AddItem()
 {
     AddListBoxItemForm dlg = new AddListBoxItemForm();
     DialogResult result = dlg.ShowDialog(this);
     if(result == DialogResult.OK)
     {
         string newItem = dlg.NewItem;
         listBox.Items.Add(newItem);
     }
 }