· web viewpublic class form1 private sub form1_formclosing(byval sender as object, byval e as...
TRANSCRIPT
![Page 1: · Web viewPublic Class Form1 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing 'Al cerrar el formulario](https://reader036.vdocument.in/reader036/viewer/2022081605/5a9ed5697f8b9a0d158bf5b2/html5/thumbnails/1.jpg)
![Page 2: · Web viewPublic Class Form1 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing 'Al cerrar el formulario](https://reader036.vdocument.in/reader036/viewer/2022081605/5a9ed5697f8b9a0d158bf5b2/html5/thumbnails/2.jpg)
Public Class Form1
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
'Al cerrar el formulario ocultar el icono de la bandeja del sistema.
NotifyIcon1.Visible = False
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Minimizar()
'Aqui declaramos este procedimiento para minimizar el formulario, ocultarlo y mostrar
'el icono en la bandeja del sistema.
Me.WindowState = FormWindowState.Minimized
If Me.WindowState = FormWindowState.Minimized Then
Hide()
NotifyIcon1.Visible = True
NotifyIcon1.ShowBalloonTip("3000", "Información", "La aplicación se está ejecutando en segundo plano", ToolTipIcon.Info)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Aquí llamamos al procedimiento que hemos creado con el nombre de Minimizar.
Call Minimizar()
End Sub
![Page 3: · Web viewPublic Class Form1 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing 'Al cerrar el formulario](https://reader036.vdocument.in/reader036/viewer/2022081605/5a9ed5697f8b9a0d158bf5b2/html5/thumbnails/3.jpg)
Private Sub RestaurarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestaurarToolStripMenuItem.Click
'Muestra la aplicación y la pone en estado normal.
Me.Show()
Me.WindowState = FormWindowState.Normal
End Sub
Private Sub OcultarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OcultarToolStripMenuItem.Click
'Minimiza la aplicación y la oculta.
Me.WindowState = FormWindowState.Minimized
Me.Hide()
End Sub
Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click
'Oculta el NotifyIcon y cierra la aplicación.
NotifyIcon1.Visible = False
End
End Sub
End Class
![Page 4: · Web viewPublic Class Form1 Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing 'Al cerrar el formulario](https://reader036.vdocument.in/reader036/viewer/2022081605/5a9ed5697f8b9a0d158bf5b2/html5/thumbnails/4.jpg)