コード例 #1
0
ファイル: frmChild.cs プロジェクト: phandd/PascalEditor
        private void richTextBox1_SelectionChanged(Object sender, EventArgs e)
        {
            //active Cut,Copy,Delete selections if there's any text selected.
            if (richTextBox1.SelectedText != "")
            {
                frmParent activeParent = (frmParent)this.MdiParent;
                activeParent.cutToolStripMenuItem.Enabled    = true;
                activeParent.copyToolStripMenuItem.Enabled   = true;
                activeParent.deleteToolStripMenuItem.Enabled = true;
            }

            //active Goto selection if there's any text in RichTextBox
            frmParent frmParentActive = (frmParent)this.MdiParent;

            if (this.richTextBox1.Text.Length != 0)
            {
                frmParentActive.gotoToolStripMenuItem.Enabled = true;
            }
        }
コード例 #2
0
ファイル: frmChild.cs プロジェクト: phandd/PascalEditor
        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            //active Undo selection if there any text
            frmParent activeParent = (frmParent)this.MdiParent;

            if (richTextBox1.TextLength != 0)
            {
                activeParent.undoToolStripMenuItem.Enabled = true;
            }



            //------------
            //load and change color of keywords
            int searchStart = 0;

            string[] lines = System.IO.File.ReadAllLines(@"reserved words.txt");
            foreach (string line in lines)
            {
                this.CheckKeyword(line, Color.Blue, 0, ref searchStart);
            }
        }