Using .Net 1.1, in a c# windows form project.
I have 3 forms, form1, form2 and form3.
form1 is my main form.
form1 contains a button that loads up form2, and form2 contains a button that loads up form3 in their respective click events.
I don't want forms 2 and 3 to appear in the task bar so i set their ShowInTaskBar property to false.
I set forms 2 and 3 Owner property to reference the instance of form1, via a singleton.
My click events therefore look something like;
My problem is, if i open form1, then form2, then form3, then close form 2, all is fine. But if i then close form3, form1 disappears ( behind whatever else is on the screen ).
I can solve the problem by doing this.Owner.BringToFront() in the child forms closing event, however this is not ideal, or by not setting either the ShowInTaskbar or Owner for the child forms.
I'm forced to set the Owner property because otherwise i get problems with message boxes not appearing under some circumstances.
Is this a known issue. If so, is there a fix. If not, does anyone know what could be causing this behaviour, and of course, how to fix it. ?
I have 3 forms, form1, form2 and form3.
form1 is my main form.
form1 contains a button that loads up form2, and form2 contains a button that loads up form3 in their respective click events.
I don't want forms 2 and 3 to appear in the task bar so i set their ShowInTaskBar property to false.
I set forms 2 and 3 Owner property to reference the instance of form1, via a singleton.
My click events therefore look something like;
Code:
Form f = new Form3();
f.ShowInTaskbar = false;
f.Owner = DisappearingMainFormDemo.Form1.GetInstance();
f.Activate();
f.Show();
I can solve the problem by doing this.Owner.BringToFront() in the child forms closing event, however this is not ideal, or by not setting either the ShowInTaskbar or Owner for the child forms.
I'm forced to set the Owner property because otherwise i get problems with message boxes not appearing under some circumstances.
Is this a known issue. If so, is there a fix. If not, does anyone know what could be causing this behaviour, and of course, how to fix it. ?