title: How to save/load data from RichTextBox to/from file
body: <p>I have Richtextbox to input text with multiple font names, color, backcolor and size. </p>
  
  <p>I want to save it and load it with the same setting.</p>
  
  <pre><code>Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
      SaveFileDialog1.Filter = "TextFile (*.txt;*.rtf)|*.txt;*.rtf|Batch File (*.bat)|*.bat|All Files (*.*)|*.*"
      SaveFileDialog1.FileName = "Untitled"
      If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
          Dim a() As String = SaveFileDialog1.FileName.Split("\")
          Dim sw As New StreamWriter(SaveFileDialog1.FileName)
          sw.Write(RichTextBox1.Text)
          My.Settings.Save()
          sw.Close()
      End If
  End Sub
  </code></pre>