Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 WindowsFormsApplication2
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- void calc()
- {
- double a, b, c;
- a = double.Parse(textBox1.Text);
- b = double.Parse(textBox2.Text);
- c = double.Parse(textBox3.Text);
- if (radioButton1.Checked)
- {
- c = Math.Pow(a, 2) + Math.Pow(b, 2);
- }
- if (radioButton2.Checked)
- {
- c = Math.Pow(a, 2) - Math.Pow(b, 2);
- }
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- calc();
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- calc();
- }
- private void textBox3_TextChanged(object sender, EventArgs e)
- {
- calc();
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- calc();
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- calc();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement