Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/01/2010, 13:57
Avatar de TheoriaX
TheoriaX
 
Fecha de Ingreso: agosto-2009
Ubicación: Hermosillo, Sonora
Mensajes: 217
Antigüedad: 14 años, 9 meses
Puntos: 5
Respuesta: Pasar datos entre 2 forms - C#

ya lo ise pero el pedo es k me genera otra ventana...te dejo el codigo...

Form 1.cs
public Form1(string t)
{
InitializeComponent();
this.label1.Text = t;
}

private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2();
f.Show();
}

Form 2.cs
private void button1_Click(object sender, EventArgs e)
{
string t = this.textBox1.Text;
Form1 f1 = new Form1(t);
f1.Show();
}

program.cs
static void Main()
{
string t = null;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new Form1(t));
}
__________________
Desarrollador .Net y Php
MCTS Framework 2.0:Windows Applications
Microsoft Certificated Profesional