La Web del Programador: Comunidad de Programadores
https://www.lawebdelprogramador.com/foros/Visual-Basic.NET/709764-Minimizar-en-el-area-de-notificacion.html

Minimizar en el area de notificacion

Minimizar en el area de notificacion

Publicado por Edu (30 intervenciones) el 31/10/2006 09:54:55
Hola.

Quisiera que cuando le doy al boton de minimizar de mi programa se minimice en el area de notificacion, al igual que lo hace el messenger y otros programas.

Gracias.

RE:Minimizar en el area de notificacion

Publicado por thessen (298 intervenciones) el 31/10/2006 11:17:39
Añade un NotifyIcon a tu formulario y en el evento Resize del formulario muestra pon visible el icono y oculta el formulario cuando minimices. Para volver a mostrar el formulario solo tienes que controlar el evento click del NotifyIcon para que vuelva a mostrar el formulario.

RE:Minimizar en el area de notificacion

Publicado por Edu (30 intervenciones) el 31/10/2006 12:23:03
Gracias Thessen.

RE:Minimizar en el area de notificacion

Publicado por Alejando (1 intervención) el 31/10/2006 13:04:35
Copiando y pegando debería funcionar:

'Código para minimizarlo en el SYSTRAY (abajo a la derecha)
Friend WithEvents Icono_Notificar As New System.Windows.Forms.NotifyIcon
Private Sub Icono_Notificar_DoubleClick(ByVal Sender As Object, ByVal e As EventArgs) Handles Icono_Notificar.DoubleClick
' Show the form when the user double clicks on the notify icon.
' Set the WindowState to normal if the form is minimized.
If (Me.WindowState = FormWindowState.Minimized) Then
Me.WindowState = FormWindowState.Normal
Icono_Notificar.Visible = False
End If
' Activate the form.
Me.ShowInTaskbar = True
Me.Activate()
End Sub
Private Sub Hoy_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.SizeChanged
If Me.WindowState = FormWindowState.Minimized Then
Me.ShowInTaskbar = False
If Not Icono_Notificar Is Nothing Then
Icono_Notificar.Visible = True

Icono_Notificar.Text = Me.Text

Else
Mostrar_Icono_Notificacion()
End If
End If
End Sub
Private Sub Mostrar_Icono_Notificacion()
' Creamos el icono de notificación
Me.Icono_Notificar = New System.Windows.Forms.NotifyIcon(Me.components)
' Le asociamos el icono que se va a visualizar
Dim Tamaño As Size
Tamaño.Height = 16
Tamaño.Width = 16
With Icono_Notificar
.Icon = New Icon(Me.Icon, Tamaño)
' Al icono de notificación le asociamos el menú contextual
'Icono_Notificar.ContextMenu = Me.Menu_Contextual
' Visualizamos el icono de notificación

.Text = Me.Text

.Visible = True
End With
End Sub

RE:Minimizar en el area de notificacion

Publicado por Edu (30 intervenciones) el 31/10/2006 13:22:38
Perfecto me faltaba el me.activate

Gracias.