
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_Windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
double p, area, a, b, c;
a = double.Parse(textBox1.Text);
b = double.Parse(textBox2.Text);
c = double.Parse(textBox3.Text);
p = (a + b + c) / 2.0f;
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();
}
}
}

No hay comentarios:
Publicar un comentario