Winforms: Schließen eines Programms in den Systemtray

'This is the event that is fired as the application is closing, whether it
'be from a close button in the application or from the user
'clicking the X in the upper right hand corner
Private Sub Form1_FormClosing(sender as Object, e as FormClosingEventArgs)   Handles Form1.FormClosing
         'What we will do here is trap the closing of the application and send the application
         'to the system tray (or so it will appear, we will just make it invisible, re-showing
         'it will be up to you and your notify icon)

        'First minimize the form
         Me.WindowState = FormWindowState.Minimized

        'Now make it invisible (make it look like it went into the system tray)
        Me.Visible = False
End Sub

Hallo nochmal Stackoverflow!

Im Versuch, um eine Anwendung, die, wenn Sie X drücken, das Programm wird put in system-tray. Aber ich habe so keine Ahnung wie ich suppost zu tun, also habe eine Suche auf google und fand diesen code. Nur VB2010 (was ich benutze) nicht wie in der vierten Zeile. Kann jemand mir eine kurze Anleitung dazu und machen diese Arbeit in VB 2010?

Übrigens, ich werde wahrscheinlich nutzen VB nur heute Abend, nur um eine einzige Anwendung. So im nicht an Sie denken learing die ganze Sprache.

  • Dies ist nicht über Visual Studio, dies ist über Winforms. Visual Studio machen kann nicht im Fenstermodus Anwendungen als gut. Bitte Bearbeiten Sie die Frage und die tags.
  • Ich entschuldige mich, im neu in diesem.
  • Keine Notwendigkeit, sich zu entschuldigen 🙂 ich versuche nur darauf hinweisen, dass die Unterscheidung zwischen Visual Studio und die APIs, die Sie verwenden, um Programme mit ihm.
  • Oh Jungs, danke für die Daumen runter! Wirklich appriciate es...!
InformationsquelleAutor Thew | 2011-10-01
Schreibe einen Kommentar