'This is the event that is fired as the application is closing, whether it
'be from a close button in the application or from the user
'clicking the X in the upper right hand corner
Private Sub Form1_FormClosing(sender as Object, e as FormClosingEventArgs) Handles Form1.FormClosing
'What we will do here is trap the closing of the application and send the application
'to the system tray (or so it will appear, we will just make it invisible, re-showing
'it will be up to you and your notify icon)
'First minimize the form
Me.WindowState = FormWindowState.Minimized
'Now make it invisible (make it look like it went into the system tray)
Me.Visible = False
End Sub
Привет еще раз Stackoverflow!
Я пытаюсь создать приложение, которое при нажатии кнопки X помещается в системный трей. Но я понятия не имею, как я должен это делать, поэтому сделал поиск в Google и нашел этот код. Только VB2010 (что я использую) не нравится четвертая строка. Кто-нибудь может дать мне краткое руководство по этому вопросу и сделать это в VB 2010?
Кстати, я, скорее всего, буду использовать VB только сегодня вечером, просто чтобы сделать одно приложение. Так что я не думаю о том, чтобы выучить весь язык.