using System; using System.Drawing; using System.Windows.Forms; using Masik; namespace Elso { public class Form1 : Form { Button gomb = new Button(); TextBox textbox1 = new TextBox(); public Form1() { gomb.Text = "Másik form megnyitása"; gomb.Location = new Point(112, 50); gomb.Click += new EventHandler(Button_Click); textbox1.Location = new Point(112, 150); Controls.Add(gomb); Controls.Add(textbox1); } public void setT(String s) { //Ezt a metódust majd a másik formból hívjuk textbox1.Text = s; } static public void Main() { Application.Run(new Form1()); } private void Button_Click(object sender, EventArgs e) { new Form2(this).Show(); } } }