How to edit the text (italics, underlined, etc.) from richtextbox to save to a text file? Tried to savefile, but something did not work.

SaveFileDialog dialog = new SaveFileDialog(); dialog.ShowDialog(); if (dialog.ShowDialog() == DialogResult.OK) { richTextBox1.SaveFile(dialog.FileName ,RichTextBoxStreamType.PlainText); } 
  • one
    remove the dialog.ShowDialog(); - Igor
  • Removed. Does not save anyway. - Andrei
  • one
    And I say - saves. - Igor
  • I probably did not say so. I need him to save the text, which is written in bold, italics, and so on. Problems he saves. - Andrei
  • one
    can matter in type? PlainText is as far as I understand the text without html. - Hasanagha Aliyev

1 answer 1

 SaveFileDialog dialog = new SaveFileDialog(); if (dialog.ShowDialog() == DialogResult.OK) { richTextBox1.SaveFile(dialog.FileName, RichTextBoxStreamType.RichText); }