Solved

Simple: When programs are minized...

Posted on 2004-03-21
6
180 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 76
Put text in a picture ASP.NET C# 2 61
Microsoft Access combo box help 2 50
Macro Excel - Multiple If conditions 2 81
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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

828 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