using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_3_1_area_de_un_triangulo_Windows
{
public partial class Form1 : Form
{
double p, area, a, b, c;
public Form1()
{
p = area = a = b = c;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
a = double.Parse(textBox1.Text);
b = double.Parse(textBox2.Text);
c = double.Parse(textBox3.Text);
p = (a + b + c) / 2.0;
area= math.sqrt(p*(p-a)*(p-b)*(p-c));
textBox4.Text = area.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
No hay comentarios:
Publicar un comentario