关闭窗体最小化到任务栏


 

 1 Protected Overrides Sub OnClosing(ByVal e As System.ComponentModel.CancelEventArgs)
 2        '  Me.ShowInTaskbar = False
 3        Me.WindowState = FormWindowState.Minimized
 4        e.Cancel = True
 5    End Sub 'OnClosing
 6
 7 
 8
 9Private Sub frmWarning_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
10        If Me.WindowState = FormWindowState.Minimized Then
11            Me.NotifyIcon2.Text = "工作提醒( " & Microsoft.VisualBasic.Left(company_name, 4& ")"
12            Me.ShowInTaskbar = False
13            Me.NotifyIcon2.Visible = True
14            Me.Hide()
15        End If
16    End Sub
17
posted @ 2008-07-09 11:07  Thin.NET  阅读(761)  评论(1编辑  收藏  举报