求窗体最大化按钮代码
窗体最大化按钮的代码怎么写、?
程序代码:
Option Explicit Private Const SC_MAXIMIZE = &HF030& Private Const SC_RESTORE = &HF120& Private Const WM_SYSCOMMAND = &H112 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub Command1_Click() SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, ByVal 0& End Sub Private Sub Command2_Click() SendMessage Me.hWnd, WM_SYSCOMMAND, SC_RESTORE, ByVal 0& End Sub