コード例 #1
0
ファイル: Form1.cs プロジェクト: mannietown/My-Dictionary
        private void textBox_Search_TextChanged(object sender, EventArgs e)
        {
            TypingInTextBox = true;
            System.Windows.Forms.TextBox textboxSearch = sender as System.Windows.Forms.TextBox;
            ModifiedRichTextBox          ModifiedRTB   = new ModifiedRichTextBox();

            try
            {
                try
                {
                    DictionaryItem DicObject = (DictionaryItem)ModifiedRTB.Search(textboxSearch.Text, ActiveDictionary.Dictionary.Root);
                    ModifiedRTB.PrintToScreen(DicObject, this.modifiedRichTextBox1);
                }
                catch (NullReferenceException)
                {
                    ActiveDictionary.InitializeActiveSearchList(ActiveDictionary.Dictionary.Root, textBox_Search.Text);
                    //ModifiedRTB.PrintToScreen(ActiveDictionary.ActiveSearchList[0], this.modifiedRichTextBox1);
                }
            }
            catch (InvalidCastException)
            {
                List <DictionaryItem> DicObject = (List <DictionaryItem>)ModifiedRTB.Search(textboxSearch.Text, ActiveDictionary.Dictionary.Root);
            }

            SearchStatus(this.label_Search, this.textBox_Search);
            TypingInTextBox = false;
            ActiveDictionary.ResetIndex();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: mannietown/My-Dictionary
        private void button3_Click(object sender, EventArgs e)
        {
            ActiveDictionary.Incre();
            ModifiedRichTextBox ModRTB = new ModifiedRichTextBox();

            try
            {
                ModRTB.PrintToScreen(ActiveDictionary.ActiveSearchList[ActiveDictionary.listIndex], this.modifiedRichTextBox1);
            }
            catch (ArgumentOutOfRangeException) { }
        }