Reputation: 10153
I have two form in my application first form is used the background and sec form showed on the first form with this code:
frsform _frsform=new frsform();
_frsform.TopLevel = true;
_frsform.ShowInTaskbar = false;
_frsform.ShowDialog();
I use this code to minimized both opened form
foreach (Form frm in Application.OpenForms)
{
frm.WindowState = FormWindowState.Minimized;
}
but when i click on task bar for maximize my application the second form is hidden and i just see first form.
what do i must do for see both forms when i maximize application?(see first form behind sec form)
Upvotes: 0
Views: 161
Reputation: 6079
Your Showing "_frsform" as an dialog over main form. When you minimize "_frsform" closing itself. So better use "Show" instead of "Showdialog".
Upvotes: 0
Reputation: 2501
Below will trap the event on your first form when you resize and allow you to then make the required adjustments to the second form:
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Maximised)
{
// add code here to show second form
}
}
Upvotes: 1