Пример #1
0
 private void TransformationButton_Click(object sender, EventArgs e)
 {
     ResultLabel.Show();
     ResultLabel.Text = "Выберите преобразование";
     comboBox1.Show();
     comboBox1.SelectedItem = comboBox1.Items[0];
     textBox1.Show();
     textBox2.Show();
     label1.Show();
     label2.Show();
     OkButton.Show();
     mode = "transform";
 }
Пример #2
0
        private void Convert(double amount, string from, string to)
        {
            //Convert from and to using GetExchangeRate to perform the correct calculation.
            double convertedAmount = (amount / GetExchangeRate(from)) * GetExchangeRate(to);

            //Get the correct currency symbols for the currencies selected. Using the region specifiers doesn't work properly.
            char currencySymbolFrom = GetCurrencySymbol(from);
            char currencySymbolTo   = GetCurrencySymbol(to);

            //Set up and show the result of the calculation. Not using the 'C' modifier because of the regional currency symbols.
            ResultLabel.Text = string.Format("{0}{1:N2} {2} is {3}{4:N2} {5}", currencySymbolFrom, amount, from, currencySymbolTo, convertedAmount, to);
            ResultLabel.Show();
        }
Пример #3
0
        private void DefinitionButton_Click(object sender, EventArgs e)
        {
            if (current_primitive == "Point")
            {
                MessageBox.Show("Выберите другой примитив", "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ResultLabel.Show();
            ResultLabel.Text = "Точка не выбрана";
            comboBox1.Hide();
            textBox1.Hide();
            textBox2.Hide();
            label1.Hide();
            label2.Hide();
            OkButton.Hide();
            mode = "define";
        }