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); } }
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); } }