Ejemplo n.º 1
0
        private void addNewBtn_Click(object sender, EventArgs e)
        {
            AddWord add = new AddWord();

            add.ShowDialog();

            if (add.name == null)
            {
                return;
            }
            else if (names.Contains(add.name))
            {
                MessageBox.Show("This word is already in the list!");
                return;
            }
            else
            {
                namesList.Items.Add(add.name);
                intellisense.Items.Add(add.name);
                names.Add(add.name);
            }
        }
Ejemplo n.º 2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddWord add = new AddWord(textBox.Text);

            add.ShowDialog();

            if (add.name == null)
            {
                return;
            }
            else if (names.Contains(add.name))
            {
                MessageBox.Show("This word is already in the list!");
                return;
            }
            else
            {
                namesList.Items.Add(add.name);
                intellisense.Items.Add(add.name);
                names.Add(add.name);
            }
            contextMenuStrip.Items[0].Text = "Add ";
        }