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 Parent child forms
Jun 19 2013 7:24 AM
in visual studio 2010 c#
i need to open a file in the Parent window then show the file contents in the child window.
i have the open file dialog and the display of the child window working.. i just cant get display the file contents into the child window.
I am doing this in the openToolStripMenuItem_Click_1 function.
Any suggestions would greatly appreciated.
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 = "this is the title bar text";
fc.Text = str;
}
if (rtb != null)
{
rtb.LoadFile(ofdOpenFile.FileName, RichTextBoxStreamType.RichText);
}
}
}
Reply
Answers (
1
)
mergin cells in datagridview vb.net
Taking specific list from database table using mvc4 razor