// VentanaPrincipal.cs // Versión 1.0 // Fecha: 6-Enero-2003 // Autor: Juan Manuel Cueva Lovelle // Ilustra el primer programa en modo Windows
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
namespace SaludoWindows { /// <summary> /// Descripción breve de Form1. /// Sólo contiene un botón /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; /// <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 Windows Form Designer generated code /// <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.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(104, 112); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "Saluda"; this.button1.Click += new System.EventHandler(this.button1_Click); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(292, 266); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.button1}); this.Name = "Form1"; this.Text = "Ventana Principal"; this.ResumeLayout(false);
} #endregion
/// <summary> /// Punto de entrada principal de la aplicación. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); }
private void button1_Click(object sender, System.EventArgs e) { MessageBox.Show("Hola a todos","Saludo"); } } }
|