TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Joseph
NA
12
3.4k
MDI form project
Jun 19 2013 7:10 AM
i need to open a file in the parent form then display it in the child form. i have a FORM1.cs file that opens the file, the opens the child window but i cant seem to understand how to show the text file contents in the child window.
I am doing this in the openToolStripMenuItem function.
how can i get the value into the child form?
any suggestions would be greatly appreciated.
-----------------------------------code start -------------------------------------------
private void openToolStripMenuItem_Click_1(object sender, EventArgs e)
{
OpenFileDialog ofdOpenFile = new OpenFileDialog();
ofdOpenFile.Title = "Select a File To Open";
ofdOpenFile.FileName = "";
ofdOpenFile.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
if (ofdOpenFile.ShowDialog() == DialogResult.OK)
{
RichTextBox rtb = GetRichTextBox();
if (rtb == null)
{
FormChild fc = new FormChild();
fc.MdiParent = this;
fc.Show();
string str = "dammit";
fc.Text = str;
}
if (rtb != null)
{
rtb.LoadFile(ofdOpenFile.FileName, RichTextBoxStreamType.RichText);
}
}
}
Reply
Answers (
8
)
How to create webmail using c# window application
mergin cells in datagridview vb.net