Solved

Minimize To Tray

Posted on 1998-09-22
5
442 Views
Last Modified: 2010-04-30
How would i minimize a program so it minimizes to the tray, or how could i do this: when the user clicks the forms minimize buttons, or on form minimize, instead of minimizeing, it hides the form, cause i know how to do the icon in the tray thing?
0
Comment
Question by:cdc_sickle
  • 2
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
BergJC earned 50 total points
ID: 1436108
Put this code in your Form_Resize function and it will hide the form when you minimize it:

Private Sub Form_Resize()
If Form1.ScaleHeight = 0 And Form1.ScaleWidth = 0 Then
    Me.Hide
End If

End Sub

0
 
LVL 2

Expert Comment

by:evertd
ID: 1436109
look at the knowledge database of microsoft at www.microsoft.com/support it explains everything you need to know about tray icon.
0
 

Author Comment

by:cdc_sickle
ID: 1436110
Ok, that worx but... How do i bring it back in the sysMnuTray popup menu
i have a thing in it called open
what code do i put in there to bring it back?
0
 
LVL 2

Expert Comment

by:BergJC
ID: 1436111
To bring it back, just put the command "YourFormName.Show"  wherever you want the form to reappear.
0
 

Author Comment

by:cdc_sickle
ID: 1436112
i did that but it blinks in the 0,0 possition in the screen and then hides again
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

810 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