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; } }
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; //} }