public ViewFeedback() { InitializeComponent(); for (int i = 0; i < Template.selectedOptionTitle.Count(); i++) { ViewAllFeedbackRichTextBox.SelectionFont = new Font(ViewAllFeedbackRichTextBox.Font, FontStyle.Bold); ViewAllFeedbackRichTextBox.AppendText(Template.sectionTitle[Template.secCount[i]]); ViewAllFeedbackRichTextBox.AppendText(Environment.NewLine); ViewAllFeedbackRichTextBox.SelectionFont = new Font(ViewAllFeedbackRichTextBox.Font, FontStyle.Regular); ViewAllFeedbackRichTextBox.AppendText(Environment.NewLine + Template.selectedOptionTitle[i]); ViewAllFeedbackRichTextBox.AppendText(Environment.NewLine + Template.selectedOptionComment[i] + Environment.NewLine); ViewAllFeedbackRichTextBox.AppendText(Environment.NewLine); } }
public void SaveMyFile() { // Create a SaveFileDialog to request a path and file name to save to. SaveFileDialog saveFile1 = new SaveFileDialog(); // Initialize the SaveFileDialog to specify the RTF extension for the file. saveFile1.DefaultExt = "*.rtf"; saveFile1.Filter = "RTF Files|*.rtf"; // Determine if the user selected a file name from the saveFileDialog. if (saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK && saveFile1.FileName.Length > 0) { // Save the contents of the RichTextBox into the file. ViewAllFeedbackRichTextBox.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText); } }