System Tray Application

hach-que

New member
Joined
Jun 19, 2008
Messages
1
Programming Experience
3-5
I'm trying to create a system tray application, but I don't know how to get it to stay there. It just exits after Sub Main(). I've tried using threads to keep the application alive, but it doesn't work.

Any ideas?
 
Could't understand

I'm trying to create a system tray application, but I don't know how to get it to stay there. It just exits after Sub Main(). I've tried using threads to keep the application alive, but it doesn't work.

Any ideas?

Hello Dude. I couldn't understand your problem. If you are serious and really want it to be solved then submit your project's code :)
 
Last edited:
You can use NotifyIcon control to achieve it. You need to assign an icon to Notify Icon which will be shown in System tray.
You have to handle form load and Double Click event of NotifyIcon control.



VB.NET:
' This method will Hide the form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Hide()      
    End Sub

' On Double clicking Form is shown again.
  Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.DoubleClick
        Show()
    End Sub
 
Back
Top