Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Minimizing to tray
Message
De
21/08/2010 15:03:15
 
 
À
21/08/2010 14:52:46
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01477733
Message ID:
01477735
Vues:
41
This adjustment has resolved it:
Public Class Form1
    Inherits Framework.Form

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

        ' Add a handler when the window will be minized
        AddHandler Resize, AddressOf MainForm_Minimize

        ' Add a handler for the notify icon MouseDown
        AddHandler NotifyIcon1.MouseDown, AddressOf NotifyIcon1_MouseDown

        ' Do not show this window in taskbar
        ShowInTaskbar = False

    End Sub

    Private Sub MainForm_Minimize(ByVal sender As Object, ByVal e As EventArgs)

        If WindowState = FormWindowState.Minimized Then
            NotifyIcon1.Visible = True
            NotifyIcon1.Text = "CCS Agent"
            Hide()
        End If

    End Sub

    Private Sub NotifyIcon1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
        Show()
        NotifyIcon1.Visible = False
        WindowState = FormWindowState.Normal
        Focus()
    End Sub

End Class
I guess with the previous version, when ShowInTaskbar=False, the EXE will be forced to be shown in the lower left of the desktop. The Hide() command resolves the issue.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform