How to update the information of one form from another without closing it?

There is an element panel1which is placed on the form of the Home and displays the form Store .
How to update element's text label1 forms of Home in the form of a Store ? So that would not close and do not interrupt her work.
April 7th 20 at 15:22
1 answer
April 7th 20 at 15:24
Pass parameter label1 in the form of a Store:
5e49e9bd130c2554977567.png
Form Store is already open, does ShowDialog not open it again ? - Rose.Gerlach commented on April 7th 20 at 15:27
@madyson.Witting, who is stopping to check it is open? and if the switch is open? - halle.Klocko commented on April 7th 20 at 15:30
@Lauriane.Nader, sorry I don't quite understand what it means to switch. If you can then please detail.
In any case, to clarify, the form is already open and if you use your method - it just opens in a new window.
(Maybe you missed the first line in the question) - Rose.Gerlach commented on April 7th 20 at 15:33
@madyson.Witting,
1 - your question is not so much reveals what and how you do* that miss was not that
2 - method I have not offered

ps * key infa - ShowDialog (this means that you don't know the Show method) and the one in comments not in question - halle.Klocko commented on April 7th 20 at 15:36
@madyson.Witting, once you create it and show right?) So when you create a declare in your form's constructor parameter or as the above has shown just give a link to your label1) ShowDialog for example used as you need.

On form No. 1 object label1 added using the visual designer and the form # 2 only property to a reference to the created object label1 form No. 1.

Edit a bit of the first and second forms and all you get) - abigail_Kohler89 commented on April 7th 20 at 15:39
@marjolaine, please See what you're missing ?
private void button1_Click(object sender, EventArgs e)
{
 openChildForm(new Form3());
}

 private void button2_Click(object sender, EventArgs e)
{
 Main Form3 = new Form3();
 main.button1.Text = "TEST"; // HERE NIFIGA NOT CHANGE
 //main.ShowDialog(); // as cited in the example - doesn't fit !
}


 List<Form> activeFormArray = new List<Form>();
 private Form activeForm = null;
 private void openChildForm(Form chilldForm)
{
 bool keyMain = false;
 foreach (Form main in activeFormArray)
{
 if (main.Text == chilldForm.Text)
{
 keyMain = true;
 activeForm = main;
 main.BringToFront(); // close the WINDOW, so a move to the forefront
}
}

 if (keyMain == false)
{
 // open child form in the panel
 activeForm = chilldForm;
activeFormArray.Add(chilldForm);
 chilldForm.TopLevel = false;
 chilldForm.FormBorderStyle = FormBorderStyle.None;
 chilldForm.Dock = DockStyle.Fill;
panel1.Controls.Add(chilldForm);
 panel1.Tag = chilldForm;
chilldForm.BringToFront();
chilldForm.Show();
}
 }
- Rose.Gerlach commented on April 7th 20 at 15:42
@madyson.Witting, maybe it's not enough for you:
// Make a global announcement 
 public Form3 Form3;
 private void button1_Click(object sender, EventArgs e)
{
 // Create a new instance of the form and pass it on
 Form3 = new Form3();
openChildForm(Form3);
}

 private void button2_Click(object sender, EventArgs e)
{
 // Thus to a previously created form
 Form3.button1.Text = "TEST";
 }
- abigail_Kohler89 commented on April 7th 20 at 15:45

Find more questions by tags C#