Beispiel #1
0
        private void SaveButton_MouseClick(object sender, MouseEventArgs e)
        {
            if (NameBox.Text == "" || WordsBox.Text == "" || PortraitBox.Text == "")
            {
                return;
            }
            message temp = new message();

            temp.name     = NameBox.Text;
            temp.words    = WordsBox.Text;
            temp.portrait = PortraitBox.Text;

            // messages.Add(temp);
            if (selected)
            {
                MessagesBox.Items[MessagesBox.SelectedIndex] = temp;
            }
            else
            {
                MessagesBox.Items.Add(temp);
            }

            NameBox.Clear();
            WordsBox.Clear();
            PortraitBox.Clear();
            MessagesBox.ClearSelected();
            selected = false;
        }
Beispiel #2
0
 private void DeselectButton_MouseClick(object sender, MouseEventArgs e)
 {
     selected = false;
     MessagesBox.ClearSelected();
     NameBox.Clear();
     WordsBox.Clear();
     PortraitBox.Clear();
 }
Beispiel #3
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            int index = MessagesBox.SelectedIndex;

            if (!(index < 0))
            {
                MessagesBox.Items.RemoveAt(index);
                MessagesBox.ClearSelected();
                NameBox.Text     = "";
                PortraitBox.Text = "";
                WordsBox.Text    = "";
            }
        }