Minimize To Tray

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?
cdc_sickleAsked:
Who is Participating?
 
BergJCConnect With a Mentor Commented:
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
 
evertdCommented:
look at the knowledge database of microsoft at www.microsoft.com/support it explains everything you need to know about tray icon.
0
 
cdc_sickleAuthor Commented:
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
 
BergJCCommented:
To bring it back, just put the command "YourFormName.Show"  wherever you want the form to reappear.
0
 
cdc_sickleAuthor Commented:
i did that but it blinks in the 0,0 possition in the screen and then hides again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.