Solved

Simple: When programs are minized...

Posted on 2004-03-21
6
179 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 25 total points
ID: 10643916
Private Sub Form_Resize()

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

End Sub
0
 
LVL 85

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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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 85

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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