private void ChooseItem(ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Text == "Формула 1") { formulae = new FormulaeFirst(); rows = new RowsFirst(); textBoxAnswer.Text += "Выбрана формула: \r\n" + "(1+2x^2)e^x^2\r\n"; } else if (e.ClickedItem.Text == "Формула 2") { formulae = new FormulaeSecond(); rows = new RowsSecond(); textBoxAnswer.Text += "Выбрана формула: \r\n" + "(e^x + e^-x)/2\r\n"; } else if (e.ClickedItem.Text == "Закрыть") { menuStrip1.Visible = false; menuStrip2.Visible = true; } else if (e.ClickedItem.Text == "Выполнить") { Run(); } }
private void ChooseItem(ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Text == "Формула 1") { formulae = new FormulaeFirst(); rows = new RowsFirst(); textBoxAnswer.Text += "Выбрана формула: \r\n" + "(1+2x^2)e^x^2\r\n"; } else if (e.ClickedItem.Text == "Формула 2") { formulae = new FormulaeSecond(); rows = new RowsSecond(); textBoxAnswer.Text += "Выбрана формула: \r\n" + "(e^x + e^-x)/2\r\n"; } else if (e.ClickedItem.Text == "Цвета(м)") { using (Form2 form2 = new Form2(this.BackColor.R, this.BackColor.G, this.BackColor.B)) { var result = form2.ShowDialog(); if (result == DialogResult.OK) { this.BackColor = form2.ColorValue; } } } else if (e.ClickedItem.Text == "Цвета") { form2 = new Form2(this.BackColor.R, this.BackColor.G, this.BackColor.B); form2.Show(); form2.ScrollBarRValueChageEvent += Form2_ScrollBar1Eventt; form2.ScrollBarGValueChageEvent += Form2_ScrollBar2Eventt; form2.ScrollBarBValueChageEvent += Form2_ScrollBar3Eventt; } else if (e.ClickedItem.Text == "Выполнить") { form2.Hide(); //Run(); } else if (e.ClickedItem.Text == "кнопка!") { form2.Visible = true; } }
public static string PrintRowAndForm(double X1, double X2, int N, double h, List <double> rowList, IFormulae formulae) { string text = null; text += $"X1 = {X1}\r\n" + $"X2 = {X2}\r\n" + $"N = {N}\r\n" + $"H = {h}\r\n"; text += "X\t|\tРяд\t|\tФормула\r\n"; for (int i = 0; i < rowList.Count; i++, X1 += h) { text += Round(X1, 2) + "\t|\t" + Round(rowList[i], 5) + "\t|\t" + Round(formulae.Formula(X1), 5) + "\r\n"; } return(text); }