none
Minimize application to taskbar programmatically RRS feed

  • Question

  • I would like to minimize my application to the taskbar programmatically. The following minimizes the current window (form)

                    Me.WindowState = FormWindowState.Minimized

    I would like to minimize the entire application. Any ideas appreciated.

    Saturday, February 25, 2017 6:37 AM

All replies

  • Thanks for the reply.

    I simplified matters and used

                    For Each frm10 As Form In Application.OpenForms
                        If frm10.Name.Trim <> "" Then
                            frm10.WindowState = FormWindowState.Minimized
                        End If
                    Next frm10
    It correctly loops though all the open forms (skips one that is blank) and minimizes to taskbar. When I click the minimized icon it restores the application but does not restore to specific form. It works in some and does not work in others.


    • Edited by JohnPapa05 Saturday, February 25, 2017 10:37 AM
    Saturday, February 25, 2017 10:10 AM
  • Remember I am trying to minimize the application (not the form). Is there an event fired "on click of taskbar icon". On the taskbar there is only one icon (windows setting), not a number of icons equal to the forms minimized.
    Saturday, February 25, 2017 10:41 AM
  • Remember I am trying to minimize the application (not the form). Is there an event fired "on click of taskbar icon". On the taskbar there is only one icon (windows setting), not a number of icons equal to the forms minimized.

    I don't understand what actually happens when you click the taskbar icon, versus what you expect to happen.

    On Windows10 with icon grouping, I click the one icon representing six minimized application windows and I get six preview windows and have to click on the one in particular that I want to restore.

    This behavior is the same with every program I open into multiple windows because it is based on my OS settings.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Saturday, February 25, 2017 2:23 PM
    Moderator
  • Hi Reed and thanks for the reply,

    I forgot to mention that my forms have no minimize box (they are borderless). In my application shown below we are 3 form levels deep and there is one icon on the bottom (There is a Windows setting whether to show one icon or in this case 3 icons). I use the code indicated before and I close all forms. When I click on the icon below, it opens the form which called the form inicated below. If I minimize from the form that called this form, it closes and opens correctly. Hope it helps.

    Sunday, February 26, 2017 12:52 PM
  • Hi JohnPapa05,

    I am glad to know that you resolve the issue and share the solution, please mark it as answer, it will be beneficial to other communities who have the similar issue.

    Best regards,

    Cole Wu


    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.

    Friday, March 3, 2017 8:45 AM
    Moderator
  • Hi Cole,

    The above is not a proposed answer.

    John

    Friday, March 3, 2017 1:14 PM
  • What is the current status? Issue resolved or not yet?
    Tuesday, February 20, 2018 5:38 PM
  • Issue is resolved
    Wednesday, February 21, 2018 6:08 AM
  • See this article Minimize all active windows.

    La vida loca

    Wednesday, February 21, 2018 2:17 PM