private void OpenButton_Click(object sender, EventArgs e) { openFileDialog1.Filter = "rtf files|*.rtf"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { TextRichTextBox.LoadFile(openFileDialog1.FileName, RichTextBoxStreamType.RichText); } }
private void LoadButton_Click(object sender, EventArgs e) { try { TextRichTextBox.LoadFile(@"../../Test.rtf"); MessageBox.Show("The file has been loaded!"); } catch (FileNotFoundException) { MessageBox.Show("File has not been saved yet!"); } }