コード例 #1
0
        private void newItemButtonLeft_Click(object sender, System.EventArgs e)
        {
            AddListBoxItemForm dlg    = new AddListBoxItemForm();
            DialogResult       result = dlg.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                string      newItem = dlg.NewItem;
                ListBoxItem item    = new ListBoxItem(newItem);
                listBox.Items.Add(item);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
 private void newItemButtonLeft_Click(object sender, System.EventArgs e)
 {
     AddListBoxItemForm dlg = new AddListBoxItemForm();
     DialogResult result = dlg.ShowDialog(this);
     if(result == DialogResult.OK)
     {
         string newItem = dlg.NewItem;
         ListBoxItem item = new ListBoxItem(newItem);
         listBox.Items.Add(item);
     }
 }
コード例 #4
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);
     }
 }