Need Help Only Need Help Only - 4 months ago 9x Question

Display msg when application is miminze to the system tray?

Is there a way to display a message tip on the system tray icon when you minimize your application to the system tray?

  1. Use the Resize event.

Use this event to detect changes in the size of your form. When the form is minimized to the tray, the WindowState property will be set to FormWindowState.Minimized.

  1. Show the balloon-tip

When the form is minimized, you can call the method ShowBalloonTip on your notify-icon.

Here's an example:

Private Sub OnResize(ByVal sender As Object, ByVal args As EventArgs) Handles Me.Resize

    If WindowState = FormWindowState.Minimized Then

        'To hide the form

        'This line does the magic (parameters: timeout in ms, title, text, icon)
        MyNotifyIcon.ShowBalloonTip(3000, "MyApp", "The app was minimized", ToolTipIcon.Info)

    End If

End Sub