洛杉矶到墨西哥自驾:VB中如何用关闭按纽实现最小化??????

来源:百度文库 编辑:高校问答 时间:2024/05/07 03:09:37
就象FLASHGET一样的

添加API声明:Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

在Form_QueryUnload()事件中,将窗体最小化,然后取消程序关闭。

最小化的方法是:
I = ShowWindow(Me.hwnd, 6)

代码如下:
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 = True
End Sub

按纽事件中将宽度和高度都设置为0