Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Simple: When programs are minized...

Posted on 2004-03-21
6
Medium Priority
?
186 Views
Last Modified: 2010-05-01
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...
0
Comment
Question by:clear100-com
  • 3
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
___XXX_X_XXX___ earned 100 total points
ID: 10643916
Private Sub Form_Resize()

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

End Sub
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 10643931
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
 

Author Comment

by:clear100-com
ID: 10643976
see i knew this, but i just was too tired or somthing, thanks.!!!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 6

Expert Comment

by:___XXX_X_XXX___
ID: 10644002
Idle_Mind,
Why not to accept your code ? It's correct solution also.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 10649069
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
 
LVL 6

Expert Comment

by:___XXX_X_XXX___
ID: 10649631
:) 10x
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question