Forum Discussion

jyothi_priya's avatar
jyothi_priya
Contributor
14 years ago

How to minimize a userform?

Hi,



Is there any control or a property of the userform where I can minimize it whenever I want just like we do with normal windows???



Thanks

Priya
  • Hi,



    Add a loop to the Main routine to constantly check the form's Visible property and exit the loop when it equals false:

    Sub Main()

    UserForms.TestForm.Show



    While UserForms.TestForm.Visible

    ' do nothing

    Wend

    End Sub
  • Hi,



    Add a loop to the Main routine to constantly check the form's Visible property and exit the loop when it equals false:

    Sub Main()

    UserForms.TestForm.Show



    While UserForms.TestForm.Visible

    ' do nothing

    Wend

    End Sub
  • Hi,



    There's no way to minimize user forms from code. You can only hide them when they're not needed and show them when your test expects some interaction from a user.
  • Hi,



    It is possible if you display your user form as a modeless window (with Show instead of ShowModal). In this case, it will have the minimize button in its header just like other windows.
  • Hi Jared,



    I want the main userform to have minimize button in the header. Using show method, it is displaying the userform for a second and then closing it.

    I have written the code as follows:



    Sub Main()

        UserForm.TestForm.Show

    End Sub



    Sub TestForm_cxButton1_OnClick()

        Action1

            -    

            -

        UserForm.TestForm.Visibile = False

    End Sub



    Now, how can I make TestForm visible till cxButton1 is clicked?
  • Thank you so much..It's working.

    Another Question is Can I minimize userform dynamically?

    I have tried UserForm .TestForm.Minimize which isn't working.