写个模块 代码如下: Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long Public Const MF_BYPOSITION = &H400&Public Sub DisableX(frm As Form) Dim hMenu As Long, nCount As Long hMenu = GetSystemMenu(frm.hWnd, 0) nCount = GetMenuItemCount(hMenu) Call RemoveMenu(hMenu, nCount - 1, MF_DISABLED Or MF_BYPOSITION) DrawMenuBar frm.hWnd End Sub 在窗体中这样调用: call DisableX(窗体名)这么详细可以给我加分了吧朋友。
代码如下:
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Const MF_BYPOSITION = &H400&Public Sub DisableX(frm As Form)
Dim hMenu As Long, nCount As Long
hMenu = GetSystemMenu(frm.hWnd, 0)
nCount = GetMenuItemCount(hMenu)
Call RemoveMenu(hMenu, nCount - 1, MF_DISABLED Or MF_BYPOSITION)
DrawMenuBar frm.hWnd
End Sub
在窗体中这样调用:
call DisableX(窗体名)这么详细可以给我加分了吧朋友。