using using using using using using using using
System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace prime { public partial class Form1 : Form { // declaracion e v globales Button suma; TextBox num1t, num2t, res; Label num1l, num2l, resl;
public Form1() { InitializeComponent(); // metodo constructor suma = new Button(); num1t = new TextBox(); num1l = new Label(); num2t = new TextBox(); num2l = new Label(); res = new TextBox(); resl = new Label(); [Link] = 100; [Link] = 40; [Link] = 200; [Link] = 40; [Link] = 300; [Link] = 40; [Link] = 100; [Link] = 200; [Link] = 300; [Link] = "suma"; [Link] = "num1"; [Link] = "num2"; [Link] = "resul"; // etiquetas // desplazamiento
[Link] += new EventHandler(this.GreetingBtn_click); metodo click [Link](suma);
//llamado
[Link](num1t); [Link](num1l); [Link](num2t); [Link](num2l); [Link](res); [Link](resl); } private void Form1_Load(object sender, EventArgs e) evento formulario { // se ejecuto 1er
void GreetingBtn_click(object sender, EventArgs e) { [Link] = [Link] + [Link]; //[Link] = [Link]; } } }
using using using using using using using using
System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace multieventos { public partial class Form1 : Form { Button suma, resta; Label n1l, n2l, resl; TextBox n1t, n2t, rest; public Form1() { InitializeComponent(); suma=new Button(); resta =new Button(); n1l = new Label(); n2l = new Label(); resl = new Label(); n1t = new TextBox(); n2t = new TextBox(); rest = new TextBox(); // posicionar los label [Link] = 100; [Link] = 200; [Link] = 300; // posicionar los text [Link] = 100; [Link] = 40; [Link] = 200; [Link] = 40; [Link] = 300; [Link] = 40; [Link] = 40; [Link] = "-"; [Link] = "+"; [Link] = "n1"; [Link] = "n2"; [Link] = "resultado"; [Link] += new EventHandler(this.suma_click); [Link] += new EventHandler(this.resta_click);
// permite adjuntar argumentos [Link](suma);
[Link](resta); [Link](n1l); [Link](n2l); [Link](resl); [Link](n1t); [Link](n2t); [Link](rest);
} private void Form1_Load(object sender, EventArgs e) evento formulario { //proceso. } void suma_click(object sender, EventArgs e) { //proceso [Link] = [Link](Convert.ToUInt32([Link]) + Convert.ToUInt32([Link])); // se ejecuto 1er
} void resta_click(object sender, EventArgs e) { //proceso [Link] = [Link](Convert.ToUInt32([Link]) + Convert.ToUInt32([Link])); } } }