Example #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frm = new frmChild();

            frm.MdiParent = this;
            frm.Show();
            saveToolStripMenuItem.Enabled  = true;
            saveSToolStripMenuItem.Enabled = true;
            if (ofd1.ShowDialog() == DialogResult.OK)
            {
                string   text      = System.IO.File.ReadAllText(ofd1.FileName);
                frmChild frmActive = (frmChild)this.ActiveMdiChild;
                if (frmActive != null)
                {
                    frmActive.richTextBox1.Text = text;
                }
                frm.Text = ofd1.FileName;

                /*StreamReader objDoc = new StreamReader(ofd1.FileName);
                 * frmChild frm = new frmChild();
                 * frm.MdiParent = this;
                 * frm.Show();
                 * frm.Text = ofd1.FileName;
                 * frm.richTextBox1.Text = objDoc.ReadToEnd();*/
            }
            ;
        }
Example #2
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frm = new frmChild();

            frm.MdiParent = this;
            frm.Show();
            i        = i + 1;
            frm.Text = "Notepad" + i;
        }
Example #3
0
        private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                frmActive.richTextBox1.Select(0, frmActive.richTextBox1.TextLength);
            }
        }
Example #4
0
        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (Clipboard.ContainsText(TextDataFormat.UnicodeText))
            {
                frmActive.richTextBox1.Paste();
            }
        }
Example #5
0
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                frmActive.richTextBox1.Undo();
            }
        }
Example #6
0
        private void timeDateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                DateTime localDate = DateTime.Now;
                frmActive.richTextBox1.Text += localDate.ToString();
            }
        }
Example #7
0
        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (printDialog1.ShowDialog() == DialogResult.OK)
                {
                }
            }
        }
Example #8
0
        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (fontDialog1.ShowDialog() == DialogResult.OK)
                {
                    frmActive.richTextBox1.Font = fontDialog1.Font;
                }
            }
        }
Example #9
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    frmActive.richTextBox1.SaveFile(saveFileDialog1.FileName, RichTextBoxStreamType.UnicodePlainText);
                }
            }
        }
Example #10
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (frmActive.richTextBox1.SelectedText != "")
                {
                    frmActive.richTextBox1.SelectedText = "";
                }
            }
        }
Example #11
0
        private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (pageSettupDialog.ShowDialog() == DialogResult.OK)
                {
                    //frmActive.richTextBox1.
                }
            }
        }
Example #12
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ofd1.ShowDialog() == DialogResult.OK)
     {
         StreamReader objDoc = new StreamReader(ofd1.FileName);
         frmChild     frm    = new frmChild();
         frm.MdiParent = this;
         frm.Show();
         frm.Text = ofd1.FileName;
         frm.richTextBox1.Text = objDoc.ReadToEnd();
     }
     ;
 }
Example #13
0
        private void saveSToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (saveAsFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string text = frmActive.GetString();
                    System.IO.File.WriteAllText(saveAsFileDialog.FileName, text);
                    //frmActive.richTextBox1.SaveFile(saveFileDialog1.FileName, RichTextBoxStreamType.PlainText);
                }
            }
        }
Example #14
0
        private void gotoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            frmActive.creatFrmGoTo().Show();
        }
Example #15
0
 public frmGoTo(frmChild frm)
 {
     frmCh = frm;
     InitializeComponent();
 }