Exemplo n.º 1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ChidForm childForm = new ChidForm();

            childForm.MdiParent = this; //sintagma asta vrea sa zica ca parintele lui childForm este acest MainForm(this)
            counter            += 1;
            childForm.Text      = "New Document " + counter;
            childForm.Show(); //asta o sa-mi activeze formul copil in MainForm
        }
Exemplo n.º 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog();

            dialog.Filter = "Rich text files|*.rtf";
            var result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                var childForm = new ChidForm();
                childForm.DocumentTextBox.LoadFile(dialog.FileName);
                childForm.Text      = dialog.FileName;
                childForm.MdiParent = this;
                childForm.Show();
            }
        }