Допустим, у меня одна и та же форма открыта несколько раз , но я хочу контролировать только одну из них ( ту, которая имеет "привет" в качестве заголовка окна (текст) <- для идентификации) </p>
Как мне это удается?
РЕДАКТИРОВАТЬ: Вот пример того, что я хочу сделать (это немного сложно, я не очень хорошо объясняю, что я хочу)
private void openthesecformfirst_Click(object sender, EventArgs e)
{
Form2 sec = new Form2();
sec.Text = "Hi";
sec.Show();
//The second form is now opened
}
private void openthesecformsecond_Click(object sender, EventArgs e)
{
Form2 sec = new Form2();
sec.Text = "Hello";
sec.Show();
//the second form is now opened twice
}
private void changelabelinfirst_Click(object sender, EventArgs e)
{
//Identified by the title the first opened form2 is supposed to change a label text
//How do I get this one specifically?
}
private void changelabelinsecond_Click(object sender, EventArgs e)
{
//Identified by the title the second opened form2 is supposed to change a label text
//How do I get this one specifically?
}