none
Minimize all windows RRS feed

  • Question

  • HI

    I have a 3 form

    1- MAIN FORM  2- DARK FORM   3- WELCOM FORM

    Problem I want to minimize the three windows taskbar together with one icon

    When you click the icon on the taskbar, I want to restore NORMAL it in the same order

    SOLUTION NOT WORK

    -IMAG 1

    - You have modified the properties of the form by hiding Welcome FORM  the icon and not appearing on the taskbar

    Another problem is that the Welcome window is minimized from the taskbar and appears at the far right of the screen

    -IMAG 2

    I used the following code but it appears 2 ICON

    CODE MINIMIZE

      For Each frm As Form In Application.OpenForms
                frm.WindowState = FormWindowState.Minimized
            Next frm




    • Edited by ahmeddc Monday, July 16, 2018 6:46 PM
    Monday, July 16, 2018 6:45 PM

Answers

  • Not sure if I understand exactly what you want to do but,  perhaps something like this will help.  Set the ShowInTaskbar property of the secondary forms to False.  Then set the owner of the secondary forms to the main Form.  When you minimize/restore the main Form,  the rest will follow.  However,  the secondary forms will always be in front of their owner,  which is the main form.

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim f2 As New Form2
            f2.ShowInTaskbar = False 'don't show Form2 in the taskbar
            f2.ControlBox = False 'stop the user from minimizing or maximizing Form2
            f2.Show(Me) 'show Form2 and use the main Form (Form1) as it's owner

            Dim f3 As New Form3
            f3.ShowInTaskbar = False
            f3.ControlBox = False
            f3.Show(Me)
        End Sub
    End Class
     

     


    If you say it can`t be done then i`ll try it

    • Marked as answer by ahmeddc Wednesday, July 18, 2018 1:01 PM
    Monday, July 16, 2018 11:15 PM
  • Hi

    Have you tried the notifyIcon control?

     Private Sub NotifyIcon1_Click(sender As Object, e As EventArgs) Handles NotifyIcon1.Click
            For Each frm As Form In Application.OpenForms
                frm.WindowState = FormWindowState.Normal
            Next frm
        End Sub

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ahmeddc Wednesday, July 18, 2018 1:01 PM
    Tuesday, July 17, 2018 6:04 AM

All replies

  • Not sure if I understand exactly what you want to do but,  perhaps something like this will help.  Set the ShowInTaskbar property of the secondary forms to False.  Then set the owner of the secondary forms to the main Form.  When you minimize/restore the main Form,  the rest will follow.  However,  the secondary forms will always be in front of their owner,  which is the main form.

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim f2 As New Form2
            f2.ShowInTaskbar = False 'don't show Form2 in the taskbar
            f2.ControlBox = False 'stop the user from minimizing or maximizing Form2
            f2.Show(Me) 'show Form2 and use the main Form (Form1) as it's owner

            Dim f3 As New Form3
            f3.ShowInTaskbar = False
            f3.ControlBox = False
            f3.Show(Me)
        End Sub
    End Class
     

     


    If you say it can`t be done then i`ll try it

    • Marked as answer by ahmeddc Wednesday, July 18, 2018 1:01 PM
    Monday, July 16, 2018 11:15 PM
  • Not sure if I understand exactly what you want to do but,  perhaps something like this will help.  Set the ShowInTaskbar property of the secondary forms to False.  Then set the owner of the secondary forms to the main Form.  When you minimize/restore the main Form,  the rest will follow.  However,  the secondary forms will always be in front of their owner,  which is the main form.

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim f2 As New Form2
            f2.ShowInTaskbar = False 'don't show Form2 in the taskbar
            f2.ControlBox = False 'stop the user from minimizing or maximizing Form2
            f2.Show(Me) 'show Form2 and use the main Form (Form1) as it's owner

            Dim f3 As New Form3
            f3.ShowInTaskbar = False
            f3.ControlBox = False
            f3.Show(Me)
        End Sub
    End Class
     

     


    If you say it can`t be done then i`ll try it

    Actually that's what I want

    But the problem with my large multi-FORM program is that I do not know the names of the open form

    What do I do for a multi-faceted program and the unknown interface name is currently active or minimized

    Monday, July 16, 2018 11:28 PM
  • Actually that's what I want

    But the problem with my large multi-FORM program is that I do not know the names of the open form

    What do I do for a multi-faceted program and the unknown interface name is currently active or minimized

     You shouldn't need to know the names of the opened forms.  If you set the Owner property of the secondary forms to the main form where they are spawned from,  the minimize/restore functionality will all be done automatically.  The rest of the properties like the ShowInTaskbar can be set in the designer window of the secondary forms.

    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Monday, July 16, 2018 11:40 PM
    Monday, July 16, 2018 11:38 PM
  • I think maybe a member will reply with a new idea
    Monday, July 16, 2018 11:58 PM
  • Hi

    Have you tried the notifyIcon control?

     Private Sub NotifyIcon1_Click(sender As Object, e As EventArgs) Handles NotifyIcon1.Click
            For Each frm As Form In Application.OpenForms
                frm.WindowState = FormWindowState.Normal
            Next frm
        End Sub

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by ahmeddc Wednesday, July 18, 2018 1:01 PM
    Tuesday, July 17, 2018 6:04 AM