Hey everyone,
I'm new at c# and I'm having some difficulties with a project I'm doing. I have a mdi program with two forms. I need to open a file into a richTextBox in the child form from the parent form. I don't know what I'm doing wrong. Any help would be much appreciated. Thanks! -Evans1404
I'm new at c# and I'm having some difficulties with a project I'm doing. I have a mdi program with two forms. I need to open a file into a richTextBox in the child form from the parent form. I don't know what I'm doing wrong. Any help would be much appreciated. Thanks! -Evans1404
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); ofd.Filter = "Text Files|*.txt"; openFileDialog1.Title = ""; if (this.openFileDialog1.ShowDialog() == DialogResult.OK) { Form2 f2 = new Form2(); f2.MdiParent = this; f2.Show(); StreamReader sr = new StreamReader(openFileDialog1.FileName); Text = sr.ReadToEnd(); sr.Close(); } }
Last edited by a moderator: