示例#1
0
 private void 새파일NToolStripMenuItem_Click(object sender, EventArgs e)
 {
     child           = new NotePadChildForm();
     child.MdiParent = this;
     child.Text      = "NONAME" + nChild++;
     child.Show();
 }
示例#2
0
        private void 저장SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                child = (NotePadChildForm)(this.ActiveMdiChild);
                string       fname  = this.Text;
                StreamWriter writer = new StreamWriter(fname);

                writer.Write(child.getTextBox().Text);

                writer.Close();
            }
        }
示例#3
0
        private void 열기OToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Stream       strm   = openFileDialog1.OpenFile();
                StreamReader reader = new StreamReader(strm);

                child           = new NotePadChildForm();
                child.MdiParent = this;
                child.Text      = "NONAME" + nChild++;
                child.Show();

                child.getTextBox().Text = reader.ReadToEnd();
                reader.Close();
                strm.Close();

                this.Text = openFileDialog1.FileName;
            }
        }
示例#4
0
 private void Undo_Click(object sender, EventArgs e)
 {
     child = (NotePadChildForm)(this.ActiveMdiChild);
     child.getTextBox().Undo();
 }