jueves, 11 de febrero de 2010

Practica 4 problema 1 "Visual"

Practica 4 problema 1

Codigo:

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_4_problema_1_visual
{
public partial class Form1 : Form
{
double x1, y1, x2, y2, distancia;
public Form1()
{
InitializeComponent();
x1 = y1 = x2 = y2 = distancia= 0.0;
}

private void button1_Click(object sender, EventArgs e)
{
x1 = double.Parse(textBox1.Text);
y1 = double.Parse(textBox2.Text);
x2 = double.Parse(textBox3.Text);
y2 = double.Parse(textBox4.Text);
distancia = Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
label5.Text = ("La distancia es=" + distancia);
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
label5.Text = " ";
}

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

private void label5_Click(object sender, EventArgs e)
{

}
}
}

No hay comentarios:

Publicar un comentario