I am trying to load files into a windows froms (vs 2010) richTextBox but only the first line of the file is loading. I'm using:
// Create an OpenFileDialog to request a file to open.
OpenFileDialog openFile1 = new OpenFileDialog();
// Initialize the OpenFileDialog to look for RTF files.
openFile1.DefaultExt = "*.rtf";
openFile1.Filter = "RTF Files|*.rtf";
// Determine whether the user selected a file from the OpenFileDialog.
if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
// Load the contents of the file into the RichTextBox.
rtbTest.LoadFile(openFile1.FileName, RichTextBoxStreamType.PlainText);
}
I've tried using rtf files created in word or word pad and have tried saving .cs files as .rtf without any success.
Any help appreciated please.