private void richTextBox2_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToInt32(e.KeyChar) == 13) { richTextBox1.Text += richTextBox2.Text; richTextBox2.Text = null; int a = weatherrand.Next(-20, 40); string rt1 = richTextBox2.Text; richTextBox1.Text += richTextBox2.Text; richTextBox2.Text = null; switch (rt1) { case "saturday": richTextBox1.Text = "The weather for Saturday is " + a + "C \n"; break; case "sunday": richTextBox1.Text = "The weather for Sunday is " + a + "C \n"; break; case "monday": richTextBox1.Text = "The weather for Monday is " + a + "C \n"; break; case "tuesday": richTextBox1.Text = "The weather for Tuesday is " + a + "C \n"; break; case "wednesday": richTextBox1.Text = "The weather for Wednesday is " + a + "C \n"; break; case "thursday": richTextBox1.Text = "The weather for Thursday is " + a + "C "; break; case "friday": richTextBox1.Text = "The weather for Friday is " + a + "C \n"; break; case "back": menu menu = new menu(); menu.Show(); this.Hide(); break; default: richTextBox1.Text = "Enter a day of the week all in lowr case to see the weather of that day \n To go back to the main manu, enter Back"; break; } } }
private void label4_Click(object sender, EventArgs e) { int a = weatherrand.Next(-20, 40); string rt1 = richTextBox2.Text; richTextBox1.Text += richTextBox2.Text; richTextBox2.Text = null; switch (rt1) { case "saturday": richTextBox1.Text = "The weather for Saturday is " + a + "C \n"; break; case "sunday": richTextBox1.Text = "The weather for Sunday is " + a + "C \n"; break; case "monday": richTextBox1.Text = "The weather for Monday is " + a + "C \n"; break; case "tuesday": richTextBox1.Text = "The weather for Tuesday is " + a + "C \n"; break; case "wednesday": richTextBox1.Text = "The weather for Wednesday is " + a + "C \n"; break; case "thursday": richTextBox1.Text = "The weather for Thursday is " + a + "C "; break; case "friday": richTextBox1.Text = "The weather for Friday is " + a + "C \n"; break; case "help": richTextBox1.Text = "Enter a day of the week all in lowr case to see the weather of that day \n To go back to the main manu, enter Back"; break; case "back": menu menu = new menu(); menu.Show(); this.Hide(); break; default: richTextBox1.Text = "The entered command not recognized, Please enter the correct command or for more questions, contact our Customer Support \n"; break; } }
private void label1_Click(object sender, EventArgs e) { if ((textBox1.Text == "") || (textBox2.Text == "")) { MessageBox.Show(nonamemessage); } else { menu menu = new menu(); menu.Show(); this.Hide(); } }
private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { if (Convert.ToInt32(e.KeyChar) == 13) { if ((textBox1.Text == "") || (textBox2.Text == "")) { MessageBox.Show(nonamemessage); } else { menu menu = new menu(); menu.Show(); this.Hide(); } } }
private void label4_Click(object sender, EventArgs e) { string rt1 = richTextBox2.Text; richTextBox1.Text += richTextBox2.Text; richTextBox2.Text = null; switch (rt1) { case "ir": richTextBox1.Text = "1 USD is 110,105 Iranian Rial"; break; case "ru": richTextBox1.Text = "1 USD is 13,954.50 Indonesian Rupiah"; break; case "ca": richTextBox1.Text = "1 USD is 1.31 Canadian Dollar"; break; case "eu": richTextBox1.Text = "1 USD is 0.87 Euros"; break; case "help": richTextBox1.Text = "The inlisted are Iranian Rial, Indonesian Rupiah, Euro and Canadian Dollar \nEnter ir for rial \nEnter ru for Rupiah \nEnter ca for Candian Dollar \nEnter eu for Euro "; break; case "back": menu menu = new menu(); menu.Show(); this.Hide(); break; default: richTextBox1.Text = "The entered command not recognized, Please enter the correct command or for more questions, contact our Customer Support \n"; break; } }