新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_COLSE = &HF060
Private Const SC_MAXIMIZE = &HF030
Private Const SC_MINIMIZE = &HF020
Private Sub Form_Load()
' 关闭、最大化、最小化按钮不可用
RemoveMenu GetSystemMenu(main.hWnd, 0), SC_COLSE, MF_REMOVE
RemoveMenu GetSystemMenu(main.hWnd, 0), SC_MAXIMIZE, MF_REMOVE
RemoveMenu GetSystemMenu(main.hWnd, 0), SC_MINIMIZE, MF_REMOVE
End Sub
Private Sub Command1_Click()
End
End Sub