24 de Junio, 2009 |
codigo de los de tarea ja |
Autor:
laloski, 22:51, guardado en
General |
el codigo ay esta namas paro no lo copien tal cual solo es para basarseen el
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
namespace nombre_pedir { /// <summary> /// Descripción breve de Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox ctnomb; private System.Windows.Forms.TextBox ctap; private System.Windows.Forms.TextBox ctam; private System.Windows.Forms.TextBox ctfe; private System.Windows.Forms.Button btcal; private System.Windows.Forms.Button btlim; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label etmen; private System.Windows.Forms.Label etej; private System.Windows.Forms.ToolTip mensaje; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.MenuItem menuItem7; private System.Windows.Forms.MenuItem menuItem9; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.MenuItem menuItem5; private System.Windows.Forms.MenuItem menuItem6; private System.Windows.Forms.MenuItem menuItem8; private System.Windows.Forms.MenuItem menuItem10; private System.Windows.Forms.ColorDialog dlgcolor; private System.ComponentModel.IContainer components;
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.components = new System.ComponentModel.Container(); this.ctnomb = new System.Windows.Forms.TextBox(); this.ctap = new System.Windows.Forms.TextBox(); this.ctam = new System.Windows.Forms.TextBox(); this.ctfe = new System.Windows.Forms.TextBox(); this.btcal = new System.Windows.Forms.Button(); this.btlim = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.etmen = new System.Windows.Forms.Label(); this.etej = new System.Windows.Forms.Label(); this.mensaje = new System.Windows.Forms.ToolTip(this.components); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuItem8 = new System.Windows.Forms.MenuItem(); this.menuItem10 = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); this.menuItem9 = new System.Windows.Forms.MenuItem(); this.dlgcolor = new System.Windows.Forms.ColorDialog(); this.SuspendLayout(); // // ctnomb // this.ctnomb.Location = new System.Drawing.Point(208, 136); this.ctnomb.Name = "ctnomb"; this.ctnomb.RightToLeft = System.Windows.Forms.RightToLeft.No; this.ctnomb.Size = new System.Drawing.Size(120, 25); this.ctnomb.TabIndex = 0; this.ctnomb.Text = ""; this.ctnomb.TextChanged += new System.EventHandler(this.ctnomb_TextChanged); // // ctap // this.ctap.Location = new System.Drawing.Point(208, 176); this.ctap.Name = "ctap"; this.ctap.Size = new System.Drawing.Size(120, 25); this.ctap.TabIndex = 1; this.ctap.Text = ""; this.ctap.TextChanged += new System.EventHandler(this.ctap_TextChanged); // // ctam // this.ctam.Location = new System.Drawing.Point(208, 216); this.ctam.Name = "ctam"; this.ctam.Size = new System.Drawing.Size(120, 25); this.ctam.TabIndex = 2; this.ctam.Text = ""; this.ctam.TextChanged += new System.EventHandler(this.ctam_TextChanged); // // ctfe // this.ctfe.Location = new System.Drawing.Point(208, 256); this.ctfe.Name = "ctfe"; this.ctfe.Size = new System.Drawing.Size(120, 25); this.ctfe.TabIndex = 3; this.ctfe.Text = ""; this.ctfe.TextChanged += new System.EventHandler(this.ctfe_TextChanged); // // btcal // this.btcal.Location = new System.Drawing.Point(40, 320); this.btcal.Name = "btcal"; this.btcal.TabIndex = 4; this.btcal.Text = "calculo"; this.btcal.Click += new System.EventHandler(this.btcal_Click); // // btlim // this.btlim.Location = new System.Drawing.Point(224, 320); this.btlim.Name = "btlim"; this.btlim.TabIndex = 5; this.btlim.Text = "limpiar"; this.btlim.Click += new System.EventHandler(this.btlim_Click); // // label1 // this.label1.Location = new System.Drawing.Point(0, 136); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(160, 23); this.label1.TabIndex = 6; this.label1.Text = "Introduce tu nombre(s)"; // // label2 // this.label2.Location = new System.Drawing.Point(0, 176); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(184, 24); this.label2.TabIndex = 7; this.label2.Text = "Introduce tu primer apellido"; // // label4 // this.label4.Location = new System.Drawing.Point(0, 256); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(200, 24); this.label4.TabIndex = 9; this.label4.Text = "Introduce tu año de nacimiento"; // // label3 // this.label3.Location = new System.Drawing.Point(0, 216); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(192, 24); this.label3.TabIndex = 10; this.label3.Text = "Introduce tu segundo apellido"; // // etmen // this.etmen.Font = new System.Drawing.Font("Monotype Corsiva", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.etmen.Location = new System.Drawing.Point(8, 32); this.etmen.Name = "etmen"; this.etmen.Size = new System.Drawing.Size(312, 80); this.etmen.TabIndex = 11; this.etmen.Text = "TU EDAD EN EL 2075"; this.etmen.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.etmen.Click += new System.EventHandler(this.etmen_Click); // // etej // this.etej.BackColor = System.Drawing.Color.Khaki; this.etej.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.etej.Location = new System.Drawing.Point(224, 280); this.etej.Name = "etej"; this.etej.Size = new System.Drawing.Size(88, 16); this.etej.TabIndex = 12; this.etej.Text = "Ejemplo: "1980""; // // mainMenu1 // this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem7}); // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem2, this.menuItem8, this.menuItem10}); this.menuItem1.Text = "Opciones"; // // menuItem2 // this.menuItem2.Index = 0; this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem3, this.menuItem4, this.menuItem5, this.menuItem6}); this.menuItem2.Text = "Cambiar color de fondo de caja"; // // menuItem3 // this.menuItem3.Index = 0; this.menuItem3.Text = "caja de nombre"; this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); // // menuItem4 // this.menuItem4.Index = 1; this.menuItem4.Text = "caja de 1er apellido"; this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click); // // menuItem5 // this.menuItem5.Index = 2; this.menuItem5.Text = "caja de 2do apellido"; this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click); // // menuItem6 // this.menuItem6.Index = 3; this.menuItem6.Text = "caja de año"; this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click); // // menuItem8 // this.menuItem8.Index = 1; this.menuItem8.Text = "-"; // // menuItem10 // this.menuItem10.Index = 2; this.menuItem10.Text = "Salir"; this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click); // // menuItem7 // this.menuItem7.Index = 1; this.menuItem7.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem9}); this.menuItem7.Text = "Ayuda"; // // menuItem9 // this.menuItem9.Index = 0; this.menuItem9.Text = "Acerca de..."; this.menuItem9.Click += new System.EventHandler(this.menuItem9_Click); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(7, 18); this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(64)), ((System.Byte)(0))); this.ClientSize = new System.Drawing.Size(336, 358); this.Controls.Add(this.etej); this.Controls.Add(this.etmen); this.Controls.Add(this.label3); this.Controls.Add(this.label4); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.btlim); this.Controls.Add(this.btcal); this.Controls.Add(this.ctfe); this.Controls.Add(this.ctam); this.Controls.Add(this.ctap); this.Controls.Add(this.ctnomb); this.Font = new System.Drawing.Font("Palatino Linotype", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Menu = this.mainMenu1; this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false);
} #endregion
/// <summary> /// Punto de entrada principal de la aplicación. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); }
private void btcal_Click(object sender, System.EventArgs e) { try { string dat; double a; dat=ctfe.Text; a=double.Parse(dat); etmen.Text="Hola"+" "+ctnomb.Text+" "+ctap.Text+" "+ctam.Text+" " +"nacido en el año"+" "+ctfe.Text+" "+"tu tendras"+" "+(2072-a)+" " +"años en el año 2075"; } catch(Exception f) { MessageBox.Show("ERROR"+Environment.NewLine+ f.Message,"Dato no valido",MessageBoxButtons.OKCancel,MessageBoxIcon.Error); } if(btcal.Enabled) { ctnomb.ReadOnly=true; ctap.ReadOnly=true; ctam.ReadOnly=true; ctfe.ReadOnly=true; } }
private void etmen_Click(object sender, System.EventArgs e) { }
private void ctnomb_TextChanged(object sender, System.EventArgs e) { }
private void ctap_TextChanged(object sender, System.EventArgs e) { }
private void ctam_TextChanged(object sender, System.EventArgs e) { }
private void ctfe_TextChanged(object sender, System.EventArgs e) { }
private void btlim_Click(object sender, System.EventArgs e) { ctnomb.Text=" "; ctap.Text=" "; ctam.Text=" "; ctfe.Text=" "; etmen.Text="GRASIAS POR USAR NUESTROS PROGRAMAS" ; if(btlim.Enabled) { ctnomb.ReadOnly=false; ctap.ReadOnly=false; ctam.ReadOnly=false; ctfe.ReadOnly=false; } }
private void Form1_Load(object sender, System.EventArgs e) { mensaje =new ToolTip(); mensaje.SetToolTip(ctnomb,"Campo para introducir tu nombre"); mensaje.SetToolTip(ctap,"campo para intruducir tu apellido paterno"); mensaje.SetToolTip(ctam,"campo para introducir tu apellido materno"); mensaje.SetToolTip(ctfe,"capo para introducir tu año de nacimiento ejemplo '1990'"); mensaje.SetToolTip(btcal,"boton para calcular tu edad en el año de 2075"); mensaje.SetToolTip(btlim,"boton para limpiar todos los campos");
}
private void menuItem10_Click(object sender, System.EventArgs e) { Close(); }
private void menuItem3_Click(object sender, System.EventArgs e) { dlgcolor.Color=ctnomb.BackColor; if (dlgcolor.ShowDialog()==DialogResult.OK){ ctnomb.BackColor=dlgcolor.Color; } }
private void menuItem4_Click(object sender, System.EventArgs e) { dlgcolor.Color=ctap.BackColor; if (dlgcolor.ShowDialog()==DialogResult.OK) { ctap.BackColor=dlgcolor.Color; } }
private void menuItem5_Click(object sender, System.EventArgs e) { dlgcolor.Color=ctam.BackColor; if (dlgcolor.ShowDialog()==DialogResult.OK) { ctam.BackColor=dlgcolor.Color; } }
private void menuItem6_Click(object sender, System.EventArgs e) { dlgcolor.Color=ctfe.BackColor; if (dlgcolor.ShowDialog()==DialogResult.OK) { ctfe.BackColor=dlgcolor.Color; } }
private void menuItem9_Click(object sender, System.EventArgs e) { MessageBox.Show("Tu edad. VERSION 1.0" + Environment.NewLine + "COPYRIGTH (C)" + Environment.NewLine + "Luis Eduado Bautista Rosale,2009","asiendo lo de nadie", MessageBoxButtons.OK ,MessageBoxIcon.Information); }
} }
|
|
Sin comentarios
· Recomendar |
|
|
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í |
Luis Eduardo Bautista R
SKATE COMPU Y ALGO MAS...
»
Ver perfil
|
|
|
Calendario |
|
Noviembre 2024 |
|
|
DO | LU | MA | MI | JU | VI | SA | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
|
|
| | |
|