Blog gratis
Reportar
Editar
¡Crea tu blog!
Compartir
¡Sorpréndeme!
un poco de programacion c·
el pedaso del lalo
17 de Junio, 2009

CODIGO DEL TEOREMA DE PITAGORAS

Autor: laloski, 02:24, guardado en General
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace teorema
{
    /// <summary>
    /// Descripción breve de Form1.
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label etteor;
        private System.Windows.Forms.Label etcata;
        private System.Windows.Forms.Label etcatb;
        private System.Windows.Forms.Label etform3;
        private System.Windows.Forms.Label etform2;
        private System.Windows.Forms.Label etres;
        private System.Windows.Forms.TextBox txres;
        private System.Windows.Forms.Button btlim;
        private System.Windows.Forms.Button btcal;
        private System.Windows.Forms.Label etform1;
        private System.Windows.Forms.TextBox txcatb;
        private System.Windows.Forms.TextBox txcata;
        /// <summary>
        /// Variable del diseñador requerida.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public Form1()
        {
            //
            // Necesario para admitir el Diseñador de Windows Forms
            //
            InitializeComponent();

            //
            // TODO: agregar código de constructor después de llamar a InitializeComponent
            //
        }

        /// <summary>
        /// Limpiar los recursos que se estén utilizando.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Código generado por el Diseñador de Windows Forms
        /// <summary>
        /// Método necesario para admitir el Diseñador. No se puede modificar
        /// el contenido del método con el editor de código.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.etteor = new System.Windows.Forms.Label();
            this.etcata = new System.Windows.Forms.Label();
            this.etcatb = new System.Windows.Forms.Label();
            this.etform3 = new System.Windows.Forms.Label();
            this.etform2 = new System.Windows.Forms.Label();
            this.etres = new System.Windows.Forms.Label();
            this.txres = new System.Windows.Forms.TextBox();
            this.btlim = new System.Windows.Forms.Button();
            this.btcal = new System.Windows.Forms.Button();
            this.etform1 = new System.Windows.Forms.Label();
            this.txcatb = new System.Windows.Forms.TextBox();
            this.txcata = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Font = new System.Drawing.Font("Monotype Corsiva", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.label1.Location = new System.Drawing.Point(70, 37);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(8, 16);
            this.label1.TabIndex = 26;
            this.label1.Text = "2";
            //
            // etteor
            //
            this.etteor.Location = new System.Drawing.Point(24, 0);
            this.etteor.Name = "etteor";
            this.etteor.Size = new System.Drawing.Size(296, 23);
            this.etteor.TabIndex = 25;
            this.etteor.Text = "TEOREMA DE PITAGORAS";
            this.etteor.Click += new System.EventHandler(this.etteor_Click);
            //
            // etcata
            //
            this.etcata.Location = new System.Drawing.Point(6, 93);
            this.etcata.Name = "etcata";
            this.etcata.TabIndex = 24;
            this.etcata.Text = "cateto  a";
            //
            // etcatb
            //
            this.etcatb.Location = new System.Drawing.Point(-2, 141);
            this.etcatb.Name = "etcatb";
            this.etcatb.TabIndex = 23;
            this.etcatb.Text = "cateto  b";
            //
            // etform3
            //
            this.etform3.Font = new System.Drawing.Font("Monotype Corsiva", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.etform3.Location = new System.Drawing.Point(166, 37);
            this.etform3.Name = "etform3";
            this.etform3.Size = new System.Drawing.Size(8, 16);
            this.etform3.TabIndex = 22;
            this.etform3.Text = "2";
            //
            // etform2
            //
            this.etform2.Font = new System.Drawing.Font("Monotype Corsiva", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.etform2.Location = new System.Drawing.Point(118, 37);
            this.etform2.Name = "etform2";
            this.etform2.Size = new System.Drawing.Size(8, 16);
            this.etform2.TabIndex = 21;
            this.etform2.Text = "2";
            //
            // etres
            //
            this.etres.Location = new System.Drawing.Point(30, 245);
            this.etres.Name = "etres";
            this.etres.Size = new System.Drawing.Size(96, 24);
            this.etres.TabIndex = 20;
            this.etres.Text = "resultado";
            //
            // txres
            //
            this.txres.Location = new System.Drawing.Point(142, 237);
            this.txres.Name = "txres";
            this.txres.ReadOnly = true;
            this.txres.Size = new System.Drawing.Size(96, 31);
            this.txres.TabIndex = 19;
            this.txres.Text = "0";
            this.txres.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // btlim
            //
            this.btlim.Location = new System.Drawing.Point(182, 189);
            this.btlim.Name = "btlim";
            this.btlim.Size = new System.Drawing.Size(80, 24);
            this.btlim.TabIndex = 18;
            this.btlim.Text = "limpiar";
            this.btlim.Click += new System.EventHandler(this.btlim_Click);
            //
            // btcal
            //
            this.btcal.Location = new System.Drawing.Point(6, 189);
            this.btcal.Name = "btcal";
            this.btcal.Size = new System.Drawing.Size(88, 24);
            this.btcal.TabIndex = 17;
            this.btcal.Text = "calcular";
            this.btcal.Click += new System.EventHandler(this.btcal_Click);
            //
            // etform1
            //
            this.etform1.Location = new System.Drawing.Point(54, 37);
            this.etform1.Name = "etform1";
            this.etform1.Size = new System.Drawing.Size(192, 32);
            this.etform1.TabIndex = 16;
            this.etform1.Text = "c  =   a   +  b  ";
            //
            // txcatb
            //
            this.txcatb.BackColor = System.Drawing.Color.Red;
            this.txcatb.Location = new System.Drawing.Point(158, 133);
            this.txcatb.Name = "txcatb";
            this.txcatb.Size = new System.Drawing.Size(128, 31);
            this.txcatb.TabIndex = 15;
            this.txcatb.Text = "0";
            this.txcatb.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // txcata
            //
            this.txcata.BackColor = System.Drawing.Color.Red;
            this.txcata.Location = new System.Drawing.Point(158, 85);
            this.txcata.Name = "txcata";
            this.txcata.Size = new System.Drawing.Size(128, 31);
            this.txcata.TabIndex = 14;
            this.txcata.Text = "0";
            this.txcata.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            //
            // Form1
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(8, 24);
            this.BackColor = System.Drawing.Color.DarkRed;
            this.ClientSize = new System.Drawing.Size(320, 278);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.etteor);
            this.Controls.Add(this.etcata);
            this.Controls.Add(this.etcatb);
            this.Controls.Add(this.etform3);
            this.Controls.Add(this.etform2);
            this.Controls.Add(this.etres);
            this.Controls.Add(this.txres);
            this.Controls.Add(this.btlim);
            this.Controls.Add(this.btcal);
            this.Controls.Add(this.etform1);
            this.Controls.Add(this.txcatb);
            this.Controls.Add(this.txcata);
            this.Cursor = System.Windows.Forms.Cursors.Hand;
            this.Font = new System.Drawing.Font("Monotype Corsiva", 15.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.ForeColor = System.Drawing.Color.Wheat;
            this.Name = "Form1";
            this.Text = "TEOREMA DE PITAGORAS";
            this.ResumeLayout(false);

        }
        #endregion

        /// <summary>
        /// Punto de entrada principal de la aplicación.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.Run(new Form1());
        }

        private void etteor_Click(object sender, System.EventArgs e)
        {
        
        }

        private void btcal_Click(object sender, System.EventArgs e)
        {
            string dat;
            double a,b,c;
            dat=txcata.Text;
            a=double.Parse(dat);
            dat=txcatb.Text;
            b=double.Parse(dat);
            c=(a*a)+(b*b);
            c=c*c;
            dat=Convert.ToString(c);
            
            txres.Text=dat;
        }

        private void btlim_Click(object sender, System.EventArgs e)
        {
          txcata.Text="";
          txcatb.Text="";
          
        }
    }
}
Palabras claves ,
1 Comentario  ·  Recomendar

img

Más sobre este tema ·  Participar
Comentarios (1) ·  Enviar comentario
YEAH MAN, DE POCA SU AYUDA
publicado por StP, el 18.06.2009 19:47
Enviar comentario

Nombre:

E-Mail (no será publicado):

Sitio Web (opcional):

Recordar mis datos.
Escriba el código que visualiza en la imagen Escriba el código [Regenerar]:
Formato de texto permitido: <b>Negrita</b>, <i>Cursiva</i>, <u>Subrayado</u>,
<li>· Lista</li>
Al margen
¡welcome a my disqBlog!
Te doy la bienvenida a my spacio en Internet. Puedes publicar tus comentarios si lo deseas.

Disfrútalo!!
Saludos
Sobre mí
FOTO

Luis Eduardo Bautista R

SKATE
COMPU
Y ALGO MAS...

» Ver perfil

Calendario
Ver mes anterior Abril 2024 Ver mes siguiente
DOLUMAMIJUVISA
123456
78910111213
14151617181920
21222324252627
282930
Buscador
Blog   Web
Tópicos
» General (8)
Nube de tags  [?]
Secciones
» Inicio
Enlaces
Más leídos
» otra estructura del try
» codigo paraa la formula gral. de la lineausing System; class formula{ private double a; private double b; private double c; public formula (double A,double B,double C) { a=A; b=B; c=C; } pu
» CODIGO DEL TEOREMA DE PITAGORAS
» AREASSSSS
» controles basicos
» estructura del try
» codigo de los de tarea ja
» calculo de pi donde n numero es =infinito pi=-4/3+4/5.....
Se comenta...
» AREASSSSS
3 Comentarios: NASH54, Juan Manuel, Nash54
» CODIGO DEL TEOREMA DE PITAGORAS
1 Comentario: StP
FULLServices Network | Blog gratis | Privacidad