/// <summary> /// This is the event handler for the tick event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SplashFormTimer_Tick(object sender, EventArgs e) { CalculatorForm calculatorForm = new CalculatorForm(); calculatorForm.Show(); this.Hide(); SplashFormTimer.Enabled = false; }
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Instantiate a new object of type CalculatorForm calculatorForm = new CalculatorForm(); Application.Run(new SplashForm()); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CalculatorForm form = new CalculatorForm(); MessageService service = new MessageService(); OperationManager manager = new OperationManager(); MainPresenter presenter = new MainPresenter(form, service, manager); Application.Run(form); }
public string MathFunc(string b, RichTextBox r, ListBox l) { CalculatorForm c = new CalculatorForm(); if ((string)l.Items[0] == "Журнала еще нет") { c.history.Clear(); } a = r.Text; if ((r.Text.IndexOf("∞") == -1)) { switch (b) { case "sqrt": r.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(r.Text))); break; case "fact": r.Text = Convert.ToString(Factorial(Convert.ToInt32(a))); break; case "sqr": r.Text = Convert.ToString(Math.Pow(Convert.ToDouble(a), 2)); break; case "cube": r.Text = Convert.ToString(Math.Pow(Convert.ToDouble(a), 3)); break; case "log": r.Text = Convert.ToString(Math.Log(Convert.ToDouble(a), 10)); break; case "ln": r.Text = Convert.ToString(Math.Log(Convert.ToDouble(a))); break; case "10": r.Text = Convert.ToString(Math.Pow(10, Convert.ToDouble(a))); break; case "sin": r.Text = Convert.ToString(Math.Sin(Convert.ToDouble(a) * Math.PI / 180)); break; case "cos": r.Text = Convert.ToString(Math.Cos(Convert.ToDouble(a) * Math.PI / 180)); break; case "tan": r.Text = Convert.ToString(Math.Tan(Convert.ToDouble(a) * Math.PI / 180)); break; } if (b == "10") { return(b + "^" + a + "=" + r.Text); } else { return(b + "(" + a + ")=" + r.Text); } } return(r.Text); }