Solved

minimizing a window on close

Posted on 2002-07-29
4
153 Views
Last Modified: 2010-05-18
Hi,

How to minimize (keep the form active) even after u have pressed the closed button.
Just like in MSN or Yahoo messenger when ever u press the close button...the form doesnt get unloaded but it remains active in the System tray.

Thanks in advance.

Chintamani.
0
Comment
Question by:chintamanidhotre
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
sanjaykattimani earned 100 total points
ID: 7184901
Write the following in form's query unload event it'll b minimized


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = 1          'Avoids closing of the window
Me.WindowState = 1  'Minimizes the window
End Sub

0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 7184902
Hi,

     Try using ShellNotifyIcon API to load ur form in the system tray.

bye

Mohan
0
 

Author Comment

by:chintamanidhotre
ID: 7184923
Thanks sanjay for the prompt and correct answer.
0
 
LVL 3

Expert Comment

by:sanjaykattimani
ID: 7184956
:) My pleasure.
0

Featured Post

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.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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