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