I was trying to create a simple like to-do list. When I click the button, it should, from another form, search for the null labels and fill in first one with the text which is written in the text box. This what I have reached so far but it doesn't work at all:
Form1 f = new Form1();
public void writetext()
{
foreach (Control x in f.Controls)
{
if (x is Label)
{
if (((Label)x).Text == "")
{
((Label)x).Text = textBox1.Text;
}
}
}
}