lunes, 28 de septiembre de 2009

Practica 3.2 Visual



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 PRACTICA3._2WINDOWS
{
public partial class Form1 : Form
{
float a, b, c, p;
double area;
public Form1()
{
InitializeComponent();
a = b = c = p =0;
area = 0;
}

private void label4_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
}

private void button3_Click(object sender, EventArgs e)
{
Close();
}

private void button2_Click(object sender, EventArgs e)
{
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text);
c = float.Parse(textBox3.Text);
p = (a + b + c) / 2.0f;
area = Math.Sqrt(p * (p - a) * (p - b) * (p - c));
textBox4.Text = area.ToString();
}
}
}

No hay comentarios:

Publicar un comentario