Public Class Form1
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const SC_CLOSE As Integer = &HF060
Const WM_SYSCOMMAND As Integer = &H112
Select Case m.Msg
Case WM_SYSCOMMAND
Select Case m.WParam.ToInt32
Case SC_CLOSE
' The close button "X" was clicked
Me.Hide()
Exit Sub ' suppress default action
End Select
End Select
MyBase.WndProc(m)
End Sub
End Class
|