dimanche 26 avril 2015

new form dissapear after creation


i'm facing a problem with form show. I have a main form where i have my GUI and i choose an option that creates an instance of a form. For example in my main form i have: Form2 f2 = new Form2(); f2.Show();

The problem is that the form shows for about 1-2 secs and then goes behind the main form. I tried some instructions in the main form below f2.Show() command like

f2.BringtoFront();
this.SendtoBack();

Also i added commands to the new form(Form2) load method:

this.BringtoFront();
this.Activate();
this.Focus();

Nothing of the above commands seems to be a solution for this. Only when I use f2.ShowDialog(); instruction in my main form but i dont want to do that because i need immediate access to both of these forms at the same time.

Any help? thanks


Aucun commentaire:

Enregistrer un commentaire