VB中如何用关闭按纽实现最小化? - 洛阳翼展电脑


VB中如何用关闭按纽实现最小化?

2023-2-15 乱云飞

添加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
本文链接:http://80c.cc/ez/628.html
0

发表评论:

VirtualCamera:在录像机中虚拟一个通道显示电脑桌面、视频文件、USB摄像头~
预ICP备10086-001号 © 翼展网/80C.CC 技术支持/洛阳翼展科技
TEL / 13213610060 QQ / 345794501
Powered by emlog