Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Form1.cs
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp2
- {
- public partial class Form1 : Form
- {
- public static int language = -1;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- if (language == 0)
- {
- label2.Text = "嗨。";
- label2.Location = new Point(291, 40);
- label3.Text = "进入线以下的数字,其根你想要的计算。";
- label3.Location = new Point(176, 74);
- label4.Text = "指定所需的精确度(<15个字符):";
- label4.Location = new Point(170, 148);
- textBox3.Location = new Point(376, 148);
- button1.Text = "计算";
- label1.Text = "你的回答:";
- label1.Location = new Point(176, 254);
- button2.Text = "输出";
- главнаяToolStripMenuItem.Text = "主";
- настройкиToolStripMenuItem.Text = "设置";
- сменитьЯзыкToolStripMenuItem.Text = "要改变语言:";
- выходToolStripMenuItem.Text = "输出";
- справкаToolStripMenuItem.Text = "帮助";
- оПрограммеToolStripMenuItem.Text = "有关程序";
- button3.Text = "对清楚的领域";
- }
- if (language == 1)
- {
- label2.Text = "Hello.";
- label2.Location = new Point(277, 40);
- label3.Text = "Enter in the line below the number whose root you want to calculate.";
- label3.Location = new Point(78, 74);
- label4.Text = "Specify the required precision(<15 characters):";
- label4.Location = new Point(110, 148);
- textBox3.Location = new Point(421, 148);
- button1.Text = "Calculate";
- label1.Text = "Your answer: ";
- label1.Location = new Point(161, 254);
- button2.Text = "Exit";
- главнаяToolStripMenuItem.Text = "Main";
- настройкиToolStripMenuItem.Text = "Settings";
- сменитьЯзыкToolStripMenuItem.Text = "Change Language:";
- выходToolStripMenuItem.Text = "Exit";
- справкаToolStripMenuItem.Text = "Help";
- оПрограммеToolStripMenuItem.Text = "About the program";
- button3.Text = "Clear the fields";
- }
- if (language == 2)
- {
- label2.Text = "Saludos.";
- label2.Location = new Point(271, 40);
- label3.Text = "Escriba en la línea por debajo de un número, la raíz de la cual se debe calcular.";
- label3.Location = new Point(37, 74);
- label4.Text = "Especifique la precisión necesaria(<15 caracteres):";
- label4.Location = new Point(93, 148);
- textBox3.Location = new Point(439, 148);
- button1.Text = "Calcular";
- label1.Text = "Su respuesta: ";
- label1.Location = new Point(182, 254);
- button2.Text = "La salida";
- главнаяToolStripMenuItem.Text = "La principal";
- настройкиToolStripMenuItem.Text = "Ajustes";
- сменитьЯзыкToolStripMenuItem.Text = "Cambiar el idioma:";
- выходToolStripMenuItem.Text = "La salida";
- справкаToolStripMenuItem.Text = "Ayuda";
- оПрограммеToolStripMenuItem.Text = "Sobre el programa de";
- button3.Text = "Borrar campos";
- }
- if (language == 3)
- {
- label2.Text = "Olá.";
- label2.Location = new Point(285, 40);
- label3.Text = "Escreva na linha abaixo do número, cuja raiz é a necessidade de calcular.";
- label3.Location = new Point(59, 74);
- label4.Text = "Especifique a precisão(<15 caracteres):";
- label4.Location = new Point(133, 148);
- textBox3.Location = new Point(399, 148);
- button1.Text = "Calcular";
- label1.Text = "Sua resposta: ";
- label1.Location = new Point(182, 254);
- button2.Text = "Saída";
- главнаяToolStripMenuItem.Text = "Página principal";
- настройкиToolStripMenuItem.Text = "Configuração";
- сменитьЯзыкToolStripMenuItem.Text = "Alterar o idioma:";
- выходToolStripMenuItem.Text = "Saída";
- справкаToolStripMenuItem.Text = "Referência";
- оПрограммеToolStripMenuItem.Text = "Sobre o programa";
- button3.Text = "Limpar os campos de";
- }
- if (language == 4)
- {
- label2.Text = "Привет.";
- label2.Location = new Point(268, 40);
- label3.Text = "Введите в строку ниже число, корень которого необходимо вычислить.";
- label3.Location = new Point(58, 74);
- label4.Text = "Укажите необходимую точность(<15 знаков):";
- label4.Location = new Point(109, 148);
- textBox3.Location = new Point(422, 148);
- button1.Text = "Вычислить";
- label1.Text = "Ваш ответ: ";
- label1.Location = new Point(171, 254);
- button2.Text = "Выход";
- главнаяToolStripMenuItem.Text = "Главная";
- настройкиToolStripMenuItem.Text = "Настройки";
- сменитьЯзыкToolStripMenuItem.Text = "Сменить язык:";
- выходToolStripMenuItem.Text = "Выход";
- справкаToolStripMenuItem.Text = "Справка";
- оПрограммеToolStripMenuItem.Text = "О программе";
- button3.Text = "Очистить поля";
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- double number;
- int acc = -1;
- bool flag = double.TryParse(textBox1.Text, out number);
- bool flag1 = Int32.TryParse(textBox3.Text, out acc);
- if (acc > 15){
- flag1 = false;
- }
- if (!flag && !flag1)
- {
- if (language == 0)
- {
- MessageBox.Show("输入正确的数量中提取和准确的!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 1)
- {
- MessageBox.Show("Enter the correct number to extract and accuracy!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 2)
- {
- MessageBox.Show("Escriba correctas número para recuperar y precisión.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 3)
- {
- MessageBox.Show("Digite corretos número para extrair e precisão!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 4)
- {
- MessageBox.Show("Введите корректные число для извлечения и точность!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- return;
- }
- if (!flag)
- {
- if (language == 0)
- {
- MessageBox.Show("输入正确的数量提取的!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 1)
- {
- MessageBox.Show("Enter the correct number to extract!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 2)
- {
- MessageBox.Show("Introduzca el número correcto para su extracción!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 3)
- {
- MessageBox.Show("Digite um número válido para a extração!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 4)
- {
- MessageBox.Show("Введите корректное число для извлечения!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- return;
- }
- if (!flag1)
- {
- if (language == 0)
- {
- MessageBox.Show("输入正确的精确!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 1)
- {
- MessageBox.Show("Enter the correct accuracy!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 2)
- {
- MessageBox.Show("Escriba la correcta precisión.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 3)
- {
- MessageBox.Show("Digite garantir a precisão!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- if (language == 4)
- {
- MessageBox.Show("Введите корректную точность!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- return;
- }
- if (number < 0)
- {
- textBox2.Text = Convert.ToString(Math.Round(Math.Sqrt(-number), acc)) + "i";
- }
- else if (number == 0)
- {
- textBox2.Text = "0";
- }
- else
- {
- textBox2.Text = Convert.ToString(Math.Round(Math.Sqrt(number), acc));
- }
- }
- private void выходToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void английскийToolStripMenuItem_Click(object sender, EventArgs e)
- {
- language = 1;
- label2.Text = "Hello.";
- label2.Location = new Point(277, 40);
- label3.Text = "Enter in the line below the number whose root you want to calculate.";
- label3.Location = new Point(78, 74);
- label4.Text = "Specify the required precision(<15 characters):";
- label4.Location = new Point(110, 148);
- textBox3.Location = new Point(421, 148);
- button1.Text = "Calculate";
- label1.Text = "Your answer: ";
- label1.Location = new Point(161, 254);
- button2.Text = "Exit";
- главнаяToolStripMenuItem.Text = "Main";
- настройкиToolStripMenuItem.Text = "Settings";
- сменитьЯзыкToolStripMenuItem.Text = "Change Language:";
- выходToolStripMenuItem.Text = "Exit";
- справкаToolStripMenuItem.Text = "Help";
- оПрограммеToolStripMenuItem.Text = "About the program";
- button3.Text = "Clear the fields";
- }
- private void китайскийToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- language = 0;
- label2.Text = "嗨。";
- label2.Location = new Point(291, 40);
- label3.Text = "进入线以下的数字,其根你想要的计算。";
- label3.Location = new Point(176, 74);
- label4.Text = "指定所需的精确度(<15个字符):";
- label4.Location = new Point(170, 148);
- textBox3.Location = new Point(376, 148);
- button1.Text = "计算";
- label1.Text = "你的回答:";
- label1.Location = new Point(176, 254);
- button2.Text = "输出";
- главнаяToolStripMenuItem.Text = "主";
- настройкиToolStripMenuItem.Text = "设置";
- сменитьЯзыкToolStripMenuItem.Text = "要改变语言:";
- выходToolStripMenuItem.Text = "输出";
- справкаToolStripMenuItem.Text = "帮助";
- оПрограммеToolStripMenuItem.Text = "有关程序";
- button3.Text = "对清楚的领域";
- }
- private void русскийToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- language = 4;
- label2.Text = "Привет.";
- label2.Location = new Point(268, 40);
- label3.Text = "Введите в строку ниже число, корень которого необходимо вычислить.";
- label3.Location = new Point(58, 74);
- label4.Text = "Укажите необходимую точность(<15 знаков):";
- label4.Location = new Point(109, 148);
- textBox3.Location = new Point(422, 148);
- button1.Text = "Вычислить";
- label1.Text = "Ваш ответ: ";
- label1.Location = new Point(171, 254);
- button2.Text = "Выход";
- главнаяToolStripMenuItem.Text = "Главная";
- настройкиToolStripMenuItem.Text = "Настройки";
- сменитьЯзыкToolStripMenuItem.Text = "Сменить язык:";
- выходToolStripMenuItem.Text = "Выход";
- справкаToolStripMenuItem.Text = "Справка";
- оПрограммеToolStripMenuItem.Text = "О программе";
- button3.Text = "Очистить поля";
- }
- private void испанскийToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- language = 2;
- label2.Text = "Saludos.";
- label2.Location = new Point(271, 40);
- label3.Text = "Escriba en la línea por debajo de un número, la raíz de la cual se debe calcular.";
- label3.Location = new Point(37, 74);
- label4.Text = "Especifique la precisión necesaria(<15 caracteres):";
- label4.Location = new Point(93, 148);
- textBox3.Location = new Point(439, 148);
- button1.Text = "Calcular";
- label1.Text = "Su respuesta: ";
- label1.Location = new Point(182, 254);
- button2.Text = "La salida";
- главнаяToolStripMenuItem.Text = "La principal";
- настройкиToolStripMenuItem.Text = "Ajustes";
- сменитьЯзыкToolStripMenuItem.Text = "Cambiar el idioma:";
- выходToolStripMenuItem.Text = "La salida";
- справкаToolStripMenuItem.Text = "Ayuda";
- оПрограммеToolStripMenuItem.Text = "Sobre el programa de";
- button3.Text = "Borrar campos";
- }
- private void португальскийToolStripMenuItem_Click_1(object sender, EventArgs e)
- {
- language = 3;
- label2.Text = "Olá.";
- label2.Location = new Point(285, 40);
- label3.Text = "Escreva na linha abaixo do número, cuja raiz é a necessidade de calcular.";
- label3.Location = new Point(59, 74);
- label4.Text = "Especifique a precisão(<15 caracteres):";
- label4.Location = new Point(133, 148);
- textBox3.Location = new Point(399, 148);
- button1.Text = "Calcular";
- label1.Text = "Sua resposta: ";
- label1.Location = new Point(182, 254);
- button2.Text = "Saída";
- главнаяToolStripMenuItem.Text = "Página principal";
- настройкиToolStripMenuItem.Text = "Configuração";
- сменитьЯзыкToolStripMenuItem.Text = "Alterar o idioma:";
- выходToolStripMenuItem.Text = "Saída";
- справкаToolStripMenuItem.Text = "Referência";
- оПрограммеToolStripMenuItem.Text = "Sobre o programa";
- button3.Text = "Limpar os campos de";
- }
- private void оПрограммеToolStripMenuItem_Click(object sender, EventArgs e)
- {
- if (language == 4)
- {
- MessageBox.Show(" Добро пожаловать!" +
- "\nМы (Семенов Никита, Мосеев Данила, Южанинова Ульяна) представляем вашему вниманию программу для извлечения квадратного корня из чисел.\nВсе права защищены.\nСпособы связи с разработчиками:\nE-mail: moseewd@gmail.com\nТелефоон: +79197085310.", "", MessageBoxButtons.OK);
- }
- if (language == 3)
- {
- MessageBox.Show(" Bem-vindo!" +
- "\nNós (Semenov Nikita, Danila Moseev, Yuzhaninova Uliana) apresentamos o programa para extrair a raiz dos números.\nTodos os direitos reservados.\nFormas de comunicação com os desenvolvedores:\nE-mail: moseewd@gmail.com\nTelefone: +79197085310.", "", MessageBoxButtons.OK);
- }
- if (language == 2)
- {
- MessageBox.Show(" Bienvenido!" +
- "\nNosotros (Semenov Nikita, Danila Moseev, Yuzhaninova Uliana) te presentamos el programa para extraer la raíz de números.\nTodos los derechos reservados.\nLa forma de contactar con los desarrolladores:\nE-mail: moseewd@gmail.com\nTeléfono: +79197085310.", "", MessageBoxButtons.OK);
- }
- if (language == 1)
- {
- MessageBox.Show(" Welcome!" +
- "\nWe (Semenov Nikita, Danila Moseev, Yuzhaninova Uliana) present the program to extract the square root of numbers.\nAll rights reserved.\nCommunication with developers:\nE-mail: moseewd@gmail.com\nPhone: +79197085310.", "", MessageBoxButtons.OK);
- }
- if (language == 0)
- {
- MessageBox.Show(" 欢迎!" +
- "\n我们 (Semenov Nikita, Danila Moseev, Yuzhaninova Uliana) 本程序中提取的数字。\n保留所有权利。\n通信与开发商:\nE-mail: moseewd@gmail.com\n电话: +79197085310.", "", MessageBoxButtons.OK);
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- textBox1.Text = "";
- textBox2.Text = "";
- textBox3.Text = "";
- }
- }
- }
- //Form2.cs
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp2
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (domainUpDown1.SelectedItem == null)
- {
- MessageBox.Show("Язык не выбран!");
- return;
- }
- Form1.language = domainUpDown1.SelectedIndex;
- Hide();
- Form1 main = new Form1();
- main.ShowDialog();
- Close();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- }
- }
- //Program.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp2
- {
- static class Program
- {
- /// <summary>
- /// Главная точка входа для приложения.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form2());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement