One way to do this is to use the ‘RichTextBox.SaveFile()’ method.
[C#]
private void button1_Click( object sender, EventArgs e )
{
// get a file name from the user
SaveFileDialog saveFile1 = new SaveFileDialog();
saveFile1.DefaultExt = '*.rtf';
saveFile1.Filter = 'RTF Files|*.rtf';
if ( saveFile1.ShowDialog() == DialogResult.OK )
richTextBox1.SaveFile( saveFile1.FileName, RichTextBoxStreamType.RichText )
}
Share with