private void buttonGetFormules_Click(object sender, EventArgs e) { int bitsCount = (int)numericUpDownN.Value; richTextBox.Text = string.Empty; this.e = MathProcessor.GetAllEK((int)Math.Pow(2, bitsCount)); b = MathProcessor.GetAllEPKFromEK(this.e); if (checkBoxOutToWord.Checked) { string wordFilePath = Environment.CurrentDirectory + "\\Formules[" + (b.Length + 1) + "].docx"; word.GenerateDocument(b, out a, wordFilePath); FillRichTextBoxFromWord(wordFilePath); progressBar.Value = 0; } else { string[] formules = MathProcessor.Formules(b, out a); for (int i = 0; i < formules.Length; i++) { richTextBox.Text += "a" + i + " =" + formules[i] + Environment.NewLine; } } }