Tessa

Tessa

  • NA
  • 1
  • 2.9k

RichTextBox

Feb 6 2011 3:31 AM

Hi!  I'm an extreme newbie, so please be nice to me. :)
I'm working in Visual Studio Express 2008.  I have a RichTextBox control.  The following code compiles, but the text file doesn't actually appear in the control:
 
 

private void ftsMenuOpen_Click(object sender, System.EventArgs e)
{
if (ofdFile.ShowDialog() == DialogResult.OK)
{
ofdFile.DefaultExt =
".txt";
ofdFile.Filter =
"Text Files|*.txt";
try
{
rtbFile.LoadFile(ofdFile.FileName,
RichTextBoxStreamType.RichText);
}
catch (ArgumentException)
{
}
}
}
I would really appreciate it if you could perhaps help me out a little :)
Thanks

Answers (5)