Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 5000
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Stop()
ShowForm(True)
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
ShowForm(False)
Me.Timer1.Start() ' just to make it pop back up after 5 seconds...
End If
End Sub
Private Sub ShowForm(ByVal MakeVisible As Boolean)
If MakeVisible Then
Me.Show()
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If
Me.ShowInTaskbar = True
Me.Opacity = 1
Else
Me.ShowInTaskbar = False
Me.Hide()
Me.Opacity = 0
End If
End Sub
End Class
|