Beispiel #1
0
        private void NewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            blank frm = new blank();

            frm.DocName   = "Untitled " + ++openDocuments;
            frm.Text      = frm.DocName;
            frm.MdiParent = this;
            frm.Show();
        }
Beispiel #2
0
        private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            blank frm = (blank)this.ActiveMdiChild;

            this.Save(frm.DocName, e);

            /* blank frm = (blank)this.ActiveMdiChild;
             * frm.Save(frm.DocName);
             * frm.IsSaved = true;*/
        }
Beispiel #3
0
        private void Frmmain_FormClosing(object sender, FormClosingEventArgs e)
        {
            blank frm = (blank)this.ActiveMdiChild;

            frm.Close();

            /*  if (frm.IsSaved == true)
            *     if (MessageBox.Show(resourceManager.GetString("MessageText"), "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            *         this.Save(frm.DocName, e);*/
        }
Beispiel #4
0
        private void ColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            blank frm = (blank)this.ActiveMdiChild;

            frm.MdiParent      = this;
            colorDialog1.Color = frm.richTextBox1.SelectionColor;
            if (colorDialog1.ShowDialog() == DialogResult.OK)
            {
                frm.richTextBox1.SelectionColor = colorDialog1.Color;
            }
            frm.Show();
        }
Beispiel #5
0
 private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         blank frm = (blank)this.ActiveMdiChild;
         frm.Save(saveFileDialog1.FileName);
         frm.MdiParent = this;
         frm.DocName   = saveFileDialog1.FileName;
         frm.Text      = frm.DocName;
         saveAsToolStripMenuItem.Enabled = true;
         frm.IsSaved = true;
     }
 }
Beispiel #6
0
 private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     saveAsToolStripMenuItem.Enabled = true;
     openFileDialog1.Filter          = "Text Files (*.txt)|*.txt|All Files(*.*)|*.*";
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         blank frm = new blank();
         frm.Open(openFileDialog1.FileName);
         frm.MdiParent = this;
         frm.DocName   = openFileDialog1.FileName;
         frm.Text      = frm.DocName;
         frm.Show();
     }
 }
Beispiel #7
0
        public void Save(object sender, System.EventArgs e)
        {
            blank frm = (blank)this.ActiveMdiChild;

            saveFileDialog1.ShowDialog();
            frm.Save(saveFileDialog1.FileName);
            //frm.DocName = saveFileDialog1.FileName;
            //FileStream filestream = File.Open(frm.DocName, FileMode.Create, FileAccess.Write);
            //if (filestream != null)
            //{
            //    StreamWriter streamwriter = new StreamWriter(filestream);
            //    streamwriter.Write(frm.richTextBox1.Text);
            //    streamwriter.Flush();
            //    filestream.Close();
            //    frm.IsSaved = true;
            //}
        }
Beispiel #8
0
 private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     blank frm = (blank)this.ActiveMdiChild; frm.Delete();
 }
Beispiel #9
0
 private void SelectAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     blank frm = (blank)this.ActiveMdiChild; frm.SelectAll();
 }