Skusam dalsi program, zase to iste pre zmenu jednoduchsi. Rovnaka chyba vo form2 24 line.
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.Show();
}
public void zapis_do_textboxu(string text)
{
textBox1.Text = text;
}
}
}
namespace WindowsFormsApplication3
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form1.zapis_do_textboxu(uloz_text());
Close();
}
private string uloz_text()
{
string text = textBox1.Text;
return text;
}
}
}