Imaginsystems


Tecniche di Programmazione - Codici Sorgenti - News Informatiche
Archivio Posts
Anno 2014

Anno 2013

Anno 2012
Statistiche
  • Views Home Page: 71.612
  • Views Posts: 542.492
  • Views Gallerie: 0
  • n° Posts: 210
  • n° Commenti: 224

VB.NET - DUE FUNZIONI APRI ED ESCI DI UN MENU NOTIFYICON

Vi è capitato di creare un menu a tendina per l'evento NotifyIcon e volete gestire bene il fatto Apri Finestra e Esci dal programma :

Con questo semplice codice voi potete Aprire la finestra e Uscire completamente dal programma  .

CODICE VB.NET 

  Private Sub Shutdown()
        If NotifyIcon1.Visible Then
            NotifyIcon1.Visible = False
        End If
        Application.Exit()
    End Sub

    Private Sub Restore()
        If Me.WindowState = FormWindowState.Minimized Then
            Me.WindowState = FormWindowState.Normal
        End If
        Me.Visible = True
    End Sub

    Private Sub mnuApri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuApri.Click
        Me.Restore()
    End Sub

    Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
        Me.Shutdown()
    End Sub
Categoria: VB.NET
sabato, 05 mag 2012 Ore. 13.26

Messaggi collegati


Ora e Data
Mappa
Blogs Amici
    Copyright © 2002-2007 - Blogs 2.0
    dotNetHell.it | Home Page Blogs
    ASP.NET 2.0 Windows 2003