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

            if (result == DialogResult.OK)
            {
                string newItem = dlg.NewItem;
                combo.Items.Add(newItem);
            }
        }
コード例 #2
0
 private void newItem_Click(object sender, System.EventArgs e)
 {
     AddComboItemForm dlg = new AddComboItemForm();
     DialogResult result = dlg.ShowDialog(this);
     if(result == DialogResult.OK)
     {
         string newItem = dlg.NewItem;
         combo.Items.Add(newItem);
     }
 }