using System; using System.Drawing; using System.Windows.Forms; using Elso; namespace Masik { public class Form2 : Form { Form1 f1; //Az első osztályból lesz egy obj. Button gomb = new Button(); TextBox textbox1 = new TextBox(); public Form2(Form1 f) { //Az f-ben kapjuk a másik form mutatóját f1 = f; gomb.Text = "Verseny"; gomb.Location = new Point(112, 50); gomb.Click += new EventHandler(Button_Click); textbox1.Location = new Point(112, 100); Controls.Add(gomb); Controls.Add(textbox1); } private void Button_Click(object sender, EventArgs e) { if(textbox1.Text.Equals("")) MessageBox.Show("Üres a szövegdoboz"); else f1.setT(textbox1.Text); } } }