Пример #1
0
        private void NewItemButtonRight_Click(object sender, System.EventArgs e)
        {
            AddListBoxItemForm dlg    = new AddListBoxItemForm();
            DialogResult       result = dlg.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                string   newItem = dlg.NewItem;
                Sailboat item    = new Sailboat(newItem, 45);
                checkedListBox.Items.Add(item, CheckState.Unchecked);
            }
        }
Пример #2
0
 private void NewItemButtonRight_Click(object sender, System.EventArgs e)
 {
     AddListBoxItemForm dlg = new AddListBoxItemForm();
     DialogResult result = dlg.ShowDialog(this);
     if(result == DialogResult.OK)
     {
         string newItem = dlg.NewItem;
         Sailboat item = new Sailboat(newItem, 45);
         checkedListBox.Items.Add(item, CheckState.Unchecked);
     }
 }