Jump to content

Teorema de Pitagoras / Um bocado NooB


will09

Recommended Posts

Bem aqui esta parte do código do projecto pode ser que ajude alguém.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Triangulo_Lados
{
public partial class Form1 : Form
{
	public Form1()
	{
		InitializeComponent();
	}

	private void button1_Click(object sender, EventArgs e)
	{
		textBox1.Text = "";
		textBox2.Text = "";
		textBox3.Text = "";
	}

	private void button2_Click(object sender, EventArgs e)
	{
		double a=0;
		double b=0;
		double c=0;

		b = double.Parse(textBox2.Text);
		c = double.Parse(textBox3.Text);

		double resultado = System.Math.Sqrt(b*b + c*c);

		textBox1.Text = resultado.ToString();
	}

	private void button3_Click(object sender, EventArgs e)
	{
		double a = 0;
		double b = 0;
		double c = 0;

		a = double.Parse(textBox1.Text);
		c = double.Parse(textBox3.Text);

		double resultado = System.Math.Sqrt(a*a-c*c);

		textBox2.Text = resultado.ToString();
	}

	private void button4_Click(object sender, EventArgs e)
	{
		double a = 0;
		double b = 0;
		double c = 0;

		a = double.Parse(textBox1.Text);
		b = double.Parse(textBox2.Text);

		double resultado = System.Math.Sqrt(a * a - b * b);

		textBox3.Text = resultado.ToString();
	}

	private void button5_Click(object sender, EventArgs e)
	{
		this.Close();
	}

	private void sairToolStripMenuItem_Click(object sender, EventArgs e)
	{
		this.Close();
	}

	private void autorToolStripMenuItem_Click(object sender, EventArgs e)
	{
		MessageBox.Show("Produzido por Jorge Colaço aka will");
	}
}
}

PEACE

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.