It’s often desireable to create applications which startup in the Notify Area (or System Tray as it’s sometimes referred to).

The most obvious way to achieve this, one would think, would be to simply set the “Visible” Property of the main form in it’s Load Event. However, as this isn’t possible we have to use a work around.

The simplest method is to set the Visible Property asynchronously using a Delegate…

Public Delegate Sub InvokeByDelegate()


’ Hide Form

Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As  System.EventArgs) Handles MyBase.Load

Me.BeginInvoke(New InvokeByDelegate(AddressOf Me.HideForm)) ‘Invoke the Hide Form Routine Asynchronously

End Sub


’ Hide the Main Form

Private Sub HideForm()

Me.Visible = False

End Sub

By |2010-11-29T15:45:00+00:00November 29th, 2010|VB.net|0 Comments

About the Author:

Leave A Comment