Minimize to Tray

Posts 1–7 of 7 · Page 1 of 1
Minimize to Tray
Hey people

Can someone please help me on how to minimize to tray?

I want to make a button that "Minimizes to try"

Help appreciated

acid_bURn
1. Add a NotifyIcon, make it visible = false
2. Add a Timer, make it enabled
3. Add this code to the timer
Code:
 If Me.WindowState = FormWindowState.Minimized Then
            NotifyIcon1.Visible = True
            Me.Hide()
        End If
4. Add this code to(copy past):
Code:
Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.Click
        Me.ShowInTaskbar = False
        Me.NotifyIcon1.Visible = False
        Me.WindowState = FormWindowState.Normal
    End Sub
5. Press the thanks button!

Enjoy
Just add a notify icon. And if you want it to not show in the try set it to visible = false. And just just add a button that minimizes it.
Quote Originally Posted by wtfiwantthatname View Post
Just add a notify icon. And if you want it to not show in the try set it to visible = false. And just just add a button that minimizes it.
Thats what i posted
Quote Originally Posted by Zoom View Post
Thats what i posted
Yeah but in a totally convoluted way.
Or You can have a form in the backround running the whole time but set its Opactity to 0% and have it moniter the form
or you could do this. like i do.
Code:
  Private Sub Form1_FormMinizing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
        'First minimize the form
        Me.WindowState = FormWindowState.Minimized

        'Now make it invisible (make it look like it went into the system tray)
        Me.Visible = False
        nfi.ShowBalloonTip(4000)
        nfi.Visible = True


Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
       if checkbox3.checked then me.minimize = true
      
       If CheckBox3.Checked Then Me.Visible = False
    
        If CheckBox3.Checked Then nfi.Visible = True
    End Sub

 Private Sub nfi_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles nfi.MouseDoubleClick
        nfi.Visible = False
        Me.WindowState = FormWindowState.Maximized

        Me.WindowState = FormStartPosition.default


        Me.Visible = True

    End Sub
nfi is my tray icon.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us