设置窗体的MaxButton属性为False

解决方案 »

  1.   


      maxbuttom=flase 
     
     来晚了! 
     
     
     楼上的说得对 !!
      

  2.   

    下面是用API实现的Option ExplicitPrivate Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
    Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    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 Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    Const MF_BYCOMMAND = &H0&
    Const MF_BYPOSITION = &H400&
    Const SC_CLOSE = &HF060&
    Const WM_CLOSE = &H10
    Const MF_REMOVE = &H1000&
    Private hMenu As Long
    Public Sub NoClose(pForm As Form)
        
        hMenu = GetSystemMenu(pForm.hwnd, 0)
        
        RemoveMenu hMenu, 6, MF_BYPOSITION Or MF_REMOVE
        RemoveMenu hMenu, 5, MF_BYPOSITION Or MF_REMOVE
        
        DrawMenuBar pForm.hwnd
        
    End SubPublic Sub NoMax(pForm As Form)
        
        hMenu = GetSystemMenu(pForm.hwnd, 0)    RemoveMenu hMenu, 4, MF_BYPOSITION Or MF_REMOVE
        RemoveMenu hMenu, 0, MF_BYPOSITION Or MF_REMOVE
        
        DrawMenuBar pForm.hwndEnd Sub
      

  3.   

    不要都用API,我看把BORADSTYLE改为NONE也可以,不过最小化也没了