In my application I have my Main Form and other borderless forms that sit on top. When I minimize the main form, I want to minimize all forms, but ONLY show the main form in the taskbar. Currently what is happening is that the Main Form goes into the task bar, but all the other open forms create mini rectangles in the bottom left corner just above the taskbar.
Is there a way I can hide these ugly rectangles? Clicking on each rectangle will bring up that particular window (which I wish to prevent). I only want to give the user the option of clicking the main form in the taskbar to bring up all windows automatically.
Thanks
Edit
To hide all forms, I have added the following code to my Resize
event in the Main Form:
Private Sub frmDashBoard_Resize(sender As Object, e As EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
If focusedForm IsNot Nothing Then
If focusedForm.Tag Is "StorePage" Then
focusedForm.WindowState = FormWindowState.Minimized
End If
End If
End If
If Me.WindowState = FormWindowState.Maximized Then
If focusedForm IsNot Nothing Then
If focusedForm.Tag Is "StorePage" Then
focusedForm.WindowState = FormWindowState.Maximized
End If
End If
End If
End Sub
Basically, I set my StorePage to focusedForm
when it is open. So focusedForm
will reference the topmost form within my application.