예제 #1
0
 private void SaveButton_Click(object sender, EventArgs e)
 {
     try
     {
         TextRichTextBox.SaveFile(@"../../Test.rtf", RichTextBoxStreamType.RichText);
         MessageBox.Show("The file has been saved!");
     }
     catch (FileNotFoundException fnfe)
     {
         MessageBox.Show(fnfe.Message);
     }
 }
예제 #2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            saveFileDialog1.Filter = "rtf files|*.rtf";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                if (TextRichTextBox.Text != "")
                {
                    TextRichTextBox.SaveFile(saveFileDialog1.FileName, RichTextBoxStreamType.RichText);
                    TextRichTextBox.Clear();
                    MessageBox.Show("Text has been saved!");
                }
            }
        }