How to get around using the SaveFile Dialog?

I'm having a problem making a little program that is similar to a word pad. I need the contents of the rich text box to save to file without using the SaveFile dialog.

As of right now i can use Streamwriter to do it, but it looses the rtf formatting. This is caused by making 

string textField = this.richTextBox1.Text.ToString();

It saves the file fine and there is no prompt to save the file. The downside is that when you open the file you just created. It's just one or to lines. It doesn't maintain any of the paragraphs or the spaces.

I've searched the web for other possible ways. Sadly they all use the save dialog approach.

So any links or help would be appreciated. Thanks



Answer this question

How to get around using the SaveFile Dialog?

  • arcdigital

    Have a look at the RichTextBox.SaveFile method.

  • ididntdoit

    Thanks for the help. I had looked at the SaveFile method. Many times to tell you the truth before i decided to ask for help.

    I was just making something so easy.... so much harder :)

    Thanks again.


  • How to get around using the SaveFile Dialog?