0
votes

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.

1
What did you entered for the ShowInTaskBar Property of your Borderless Forms? - j_s_stack
hide the minimized windows (aka ugly rectangles) with ShowInTaskBar = True - Ňɏssa Pøngjǣrdenlarp
I have the ShowInTaskBar property set to False. If I set it to True, then I get an entry in the taskbar for that individual window which I don't want. I only want a single taskbar entry for the Main Form...if possible. - Riples
Can you please post the code you use to hide the forms - j_s_stack
It Looks like you want to devlop some Kind of Dashboard, did you though about creating a MDI Application - j_s_stack

1 Answers

0
votes

Don't minimize your forms, make them invisible instead, which if you don't want to see them, nor have them show in the taskbar, is really what you want:

If focusedForm.Tag Is "StorePage" Then
    focusedForm.Visible = (Me.WindowState <> FormWindowState.Minimized)
End If

etc.