Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : Form
- {
- MatikkaNero math;
- public Form1()
- {
- InitializeComponent();
- math = new MatikkaNero();
- }
- private void comboBox_LaskuToimitus_SelectedIndexChanged(object sender, EventArgs e)
- {
- // if (textBox_1 != null && textBox_2 != null)
- // {
- if (comboBox_LaskuToimitus.SelectedIndex == 0)
- {
- math.Tulos = math.Summa(math.Luku1, math.Luku2);
- textBox_Result.Text = Convert.ToString(math.Tulos);
- } // summa
- if (comboBox_LaskuToimitus.SelectedIndex == 1)
- {
- math.Tulos = math.Erotus(math.Luku1, math.Luku2);
- textBox_Result.Text = Convert.ToString(math.Tulos);
- } // erotus
- if (comboBox_LaskuToimitus.SelectedIndex == 2)
- {
- math.Tulos = math.Tulo(math.Luku1, math.Luku2);
- textBox_Result.Text = Convert.ToString(math.Tulos);
- } // tulo
- if (comboBox_LaskuToimitus.SelectedIndex == 3)
- {
- math.Tulos = math.Osamaara(math.Luku1, math.Luku2);
- textBox_Result.Text = Convert.ToString(math.Tulos);
- } // osamäärä
- if (comboBox_LaskuToimitus.SelectedIndex == 4)
- {
- math.Tulos = math.Potenssi(math.Luku1, math.Luku2);
- textBox_Result.Text = Convert.ToString(math.Tulos);
- } // potenssi
- //}
- }
- private void textBox_1_TextChanged(object sender, EventArgs e)
- {
- math.Luku1 = Convert.ToDouble(textBox_1.Text);
- // if (comboBox_LaskuToimitus != null && textBox_2 != null)
- // {
- // }
- }
- private void textBox_2_TextChanged(object sender, EventArgs e)
- {
- math.Luku2 = Convert.ToDouble(textBox_2.Text);
- // if (textBox_1 != null && comboBox_LaskuToimitus != null)
- // {
- //}
- }
Add Comment
Please, Sign In to add comment