Пример #1
0
 private void DetailButton_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (DetailButton.Text == "显示详情")
     {
         DetailButton.Text = "关闭详情";
         InformationBox.Show();
         this.Height = 306;
     }
     else
     {
         DetailButton.Text = "显示详情";
         InformationBox.Hide();
         this.Height = 164;
     }
 }
Пример #2
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                TranslationGrid.Hide();
                InformationBox.Show();
                InformationBox.Text = "this is not a valid list";
                return;
            }

            FileName = listBox1.SelectedItem.ToString();
            var wordList = WordList.LoadList(FileName);

            if (wordList == null)
            {
                return;
            }
            TranslationGrid.Show();
            AddButton.Show();
            NewListButton.Show();
            RemoveButton.Show();
            SaveButton.Show();
            PracticeButton.Show();
            AddButton.Enabled    = true;
            SaveButton.Enabled   = true;
            RemoveButton.Enabled = true;
            InformationBox.Hide();
            var languageArray = wordList.Languages;
            var sortBy        = 0;

            CountLabel.Text = $"There are {wordList.Count()} words in the list";
            TranslationGrid.Rows.Clear();
            TranslationGrid.Columns.Clear();
            TranslationGrid.Refresh();
            foreach (var languages in languageArray)
            {
                TranslationGrid.Columns.Add("newColumnName", languages.ToUpper());
            }
            TranslationGrid.Rows.Clear();

            wordList.List(sortBy, x => { TranslationGrid.Rows.Add(x); });
        }
Пример #3
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                InformationBox.Hide();
                var name = listBox1.SelectedItem.ToString();
                new Form1(name);
                var languageArray = WordList.LoadList(name).Languages;
                var sortBy        = 0;

                CountLabel.Text = $"There are {WordList.LoadList(name).Count()} words in the list";
                TranslationGrid.Rows.Clear();
                TranslationGrid.Columns.Clear();
                TranslationGrid.Refresh();
                foreach (var languages in languageArray)
                {
                    TranslationGrid.Columns.Add("newColumnName", languages.ToUpper());
                }
                TranslationGrid.Rows.Clear();

                WordList.LoadList(name).List(sortBy, x => { TranslationGrid.Rows.Add(x); });
            }
        }