Beispiel #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();*/
            }
            ;
        }
Beispiel #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;
        }
Beispiel #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);
            }
        }
Beispiel #4
0
        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

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

            if (frmActive != null)
            {
                frmActive.richTextBox1.Undo();
            }
        }
Beispiel #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();
            }
        }
Beispiel #7
0
        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

            if (frmActive != null)
            {
                if (printDialog1.ShowDialog() == DialogResult.OK)
                {
                }
            }
        }
Beispiel #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;
                }
            }
        }
Beispiel #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);
                }
            }
        }
Beispiel #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 = "";
                }
            }
        }
Beispiel #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.
                }
            }
        }
Beispiel #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();
     }
     ;
 }
Beispiel #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);
                }
            }
        }
Beispiel #14
0
        private void gotoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmChild frmActive = (frmChild)this.ActiveMdiChild;

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