Post[Question]About Traybar

Posts 1–5 of 5 · Page 1 of 1
[Question]About Traybar
How Could I Put My Program At The Traybar Icons Instead At The Taskbar???

I'm Using Visual Basic 8...
Using a notifyicon and a contextmenustrip..

on form_load

Me.ShowInTaskbar = False
NotifyIcon1.ContextMenuStrip = ContextMenuStrip1

You also have to set an icon for the notifyicon, else you won't be able to see it.
put in you program ShowInTaskBar = True
there you go
Form Load (Set Icon)
Code:
 Me.NotifyIcon1.Icon = Me.Icon

Form Load, Set it true

Code:
Me.NotifyIcon1.Visible = true

VB Syntax for Minimizing to System Tray

Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        NotifyIcon1.Visible = False
    End Sub
 
    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
        Try
            Me.Show()
            Me.WindowState = FormWindowState.Normal
            NotifyIcon1.Visible = False
 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
 
    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        Try
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Minimized
                NotifyIcon1.Visible = True
                Me.Hide()
            End If
 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

Show Balloon Tip
(use on minimize, but can be adjusted for anything

Code:
notifyIcon1.ShowBalloonTip(3000, "Your App", ("Application has not closed" & DirectCast((13), [Char]) & "You can access it from System tray") + DirectCast((13), [Char]) & "Right click the Icon to exit.", ToolTipIcon . info
Thank You NextGen1... [1/10 For Me To Support You!!]
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us