예제 #1
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FormChild MDIchild = new FormChild();
     MDIchild.MdiParent = this;
     MDIchild.Text = "Form - " + this.MdiChildren.Length.ToString();
     MDIchild.Show();
 }
예제 #2
0
 private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
 {
     FormChild MDIchild = new FormChild();
     MDIchild.MdiParent = this;
     string extension = System.IO.Path.GetExtension(openFileDialog1.FileName);
     RichTextBoxStreamType rtbst = RichTextBoxStreamType.PlainText;
     switch (extension)
     {
         case ".txt":
             rtbst = RichTextBoxStreamType.PlainText;
             break;
         case ".rtf":
             rtbst = RichTextBoxStreamType.RichText;
             break;
     }
     MDIchild.Editor.LoadFile(openFileDialog1.FileName, rtbst);
     MDIchild.Text = openFileDialog1.FileName;
     MDIchild.Editor.Modified = false;
     MDIchild.Show();
 }