展开全部
那你的程序在按上关闭按钮后需要有什么动作呢?如果是要让关闭按钮失效的话可以加上这些语句:
Private Sub Form_Unload(Cancel As Integer)
Cancel = 1 '=0时就可以关闭程序了。
End Sub
如果是按关闭按钮实现最小化的话要用API了,如下
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
I = ShowWindow(Me.hwnd, 6)
Cancel = 1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Cancel = 1 '=0时就可以关闭程序了。
End Sub
如果是按关闭按钮实现最小化的话要用API了,如下
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
I = ShowWindow(Me.hwnd, 6)
Cancel = 1
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询