Simple: When programs are minized...

Hello, I want to be able to run some code when the user minimizes the program, i know this can be done because it happens on a lot of programs.  I want to hide the form when this happens because it resedents in the system tray.  So all i need is how to figure out when it is minized.

Thanks...
clear100-comAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
___XXX_X_XXX___Connect With a Mentor Commented:
Private Sub Form_Resize()

If Me.WindowState = vbMinimized Then
   MsgBox "Run your code here"
End If

End Sub
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Private Sub Form_Resize()
    If Me.WindowState = vbMinimized Then
        Me.Hide
    End If
End Sub

DON'T ACCEPT THIS AS AN ANSWER!!!

Accept the solution from ___XXX_X_XXX___

Idle_Mind


0
 
clear100-comAuthor Commented:
see i knew this, but i just was too tired or somthing, thanks.!!!
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
___XXX_X_XXX___Commented:
Idle_Mind,
Why not to accept your code ? It's correct solution also.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Because I just changed one line in your code which I think clear100-com would have known to do.  Your answer had the main part of the solution...my poor brain just couldn't leave the question without posting the complete answer.

You posted first so I felt you should get the points.

Idle_Mind
0
 
___XXX_X_XXX___Commented:
:) 10x
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.