예제 #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;
        }
예제 #2
0
 private void DeselectButton_MouseClick(object sender, MouseEventArgs e)
 {
     selected = false;
     MessagesBox.ClearSelected();
     NameBox.Clear();
     WordsBox.Clear();
     PortraitBox.Clear();
 }