Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Minimize Form in System Tray

, 12 Feb 2010
Rate this:
Please Sign up or sign in to vote.
Note that you must select NotifyIcon1 from the ToolBox and set any icon to its icon property plus make 3 buttons or you can write minimize to tray code in the form closing event.Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As...
Note that you must select NotifyIcon1 from the ToolBox and set any icon to its icon property plus make 3 buttons or you can write minimize to tray code in the form closing event.
 
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click
        Me.WindowState = FormWindowState.Minimized
    End Sub
 
    Private Sub Button2_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button2.Click
        Application.Exit()
    End Sub
 
    Private Sub Button3_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button3.Click
        Me.WindowState = FormWindowState.Minimized
        Me.Visible = False
        NotifyIcon1.Visible = True
    End Sub
 
    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, _
        ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
        Me.Visible = True
        Me.WindowState = FormWindowState.Normal
        NotifyIcon1.Visible = False
    End Sub
End Class

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 Pinmemberalex.barylski20-Feb-13 6:23 
QuestionAlternate Pinmemberaspdotnetdev12-Feb-10 19:59 
AnswerRe: Alternate PinmvpLuc Pattyn23-Jul-10 3:55 
GeneralRe: Alternate Pinmemberaspdotnetdev23-Jul-10 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 13 Feb 2010
Article Copyright 2010 by Pratik M Mahajan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid