Return to Snippet

Revision: 24642
at March 7, 2010 09:31 by bennyty


Initial Code
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        If Me.WindowState = FormWindowState.Minimized Then
            Me.Hide()
        End If
    End Sub
    Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
        If Me.WindowState = FormWindowState.Minimized Then
            Me.Show()
            Me.WindowState = FormWindowState.Normal
        End If
    End Sub

Initial URL

                                

Initial Description
When the form minimizes it will hide and make an "Notifyicon" in the taskbar, when clicked it will reopen the form. I suggest adding a ContextMenuStrip to the notify icon to make right clicking possible.

Initial Title
Minimize to Tray

Initial Tags

                                

Initial Language
VB.NET