startup in system tray

Johnson

Well-known member
Joined
Mar 6, 2009
Messages
158
Programming Experience
Beginner
This function seems so hard to do. Some one sugested using a coponent as startup but this is no good.

Basically i only want my app to load in tray if it loads on windows startup.

This is caleld on load

VB.NET:
            If My.Settings.AutoRun = True Then
                chkStartup.Checked = True
                _SendTray = True
                Me.WindowState = FormWindowState.Minimized
            End If

VB.NET:
        Private Sub ClientForm_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

it works any other time, the resize event. just not onload.
 
Use the Shown() event instead.

When you use the Load() event, there's no form showing for it to minimize
 
Hello.just one question. does the shown event only come after the load event?

Not every time the form hides then reSHOWN? if you see what i mean?
 
Hello.just one question. does the shown event only come after the load event?

Not every time the form hides then reSHOWN? if you see what i mean?

Form.Shown Event (System.Windows.Forms)
The Shown event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event.
Does this answer your question?
 
Back
Top