Exemplo n.º 1
0
        private void OpenButton_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "rtf files|*.rtf";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                TextRichTextBox.LoadFile(openFileDialog1.FileName, RichTextBoxStreamType.RichText);
            }
        }
Exemplo n.º 2
0
 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!");
     }
 }