private void hTMLToolStripMenuItem1_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "HTML with <PRE> tag|*.html|HTML without <PRE> tag|*.html"; if (sfd.ShowDialog() == DialogResult.OK) { string html = ""; if (sfd.FilterIndex == 1) { html = fctb.Html; } if (sfd.FilterIndex == 2) { ExportToHTML exporter = new ExportToHTML(); exporter.UseBr = true; exporter.UseNbsp = false; exporter.UseForwardNbsp = true; exporter.UseStyleTag = true; html = exporter.GetHtml(fctb); } File.WriteAllText(sfd.FileName, html); } }