namespace ComponentsView { public partial class FormComponents : Form { public FormComponents() { InitializeComponent(); testComponent.FileName = "2.txt"; } private void buttonSaveText_Click(object sender, EventArgs e) { try { testComponent.SaveToFile(richTextBoxTest.Lines); MessageBox.Show("Сохарнено успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void buttonSaveTextWord_Click(object sender, EventArgs e) { componentBigText.SetText(string.Empty); } } }