none
How to restore minimized userform RRS feed

  • Question

  • I have used API to add minimize button to the top right hand corner just like the one in IE or MS Office. I also use API to add a system tray icon after I have minimized the userform. However, when i double click the system tray icon, the userform appear again but remains minimized and I dont know how to restore the size of userform programmatically.

     

    Can anyone help?

     

    Thank You

    Wednesday, March 5, 2008 3:39 AM

Answers

  • Hi,

    You haven't posted any code so I do not know what you are aware of.
    You need to use the ShowWindow API

    Code Snippet

    Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


    Const SW_SHOWNORMAL = 1



    I assume you know how to get the handle of the userform as you have managed to add menu buttons.

    Code Snippet


        ShowWindow mhWndForm, SW_SHOWNORMAL




    Thursday, March 6, 2008 1:55 PM

All replies

  • Any method to restore minimized userform programmatically?

     

    Please help

    Thank You

    Thursday, March 6, 2008 3:38 AM
  • Hi,

    You haven't posted any code so I do not know what you are aware of.
    You need to use the ShowWindow API

    Code Snippet

    Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


    Const SW_SHOWNORMAL = 1



    I assume you know how to get the handle of the userform as you have managed to add menu buttons.

    Code Snippet


        ShowWindow mhWndForm, SW_SHOWNORMAL




    Thursday, March 6, 2008 1:55 PM