I have a rich text box, and am having difficulty saving my file using the save file dialog (I want to let the user be able to browse to a specific location on their computer.) Could anyone please help me.
Problem Solved now. But I am having one other little issue. When I have a rich text box that is blank, I want a messagbox to display saying that it is not possible to save a blank textbox. I have tried if/else statements but this did not seem to work. Here is the code below.
private void button4_Click(object sender, RoutedEventArgs e)
TextRange textRange = new TextRange(richTextBox2.Document.ContentStart, richTextBox2.Document.ContentEnd);
SaveFileDialog dlg = new SaveFileDialog();
dlg.Filter = "pdb Files (*pdb) | * pdb";
if (dlg.ShowDialog() == true)
using (FileStream fs = new FileStream(dlg.FileName, FileMode.OpenOrCreate))