如何禁止Access主窗体右上角的退出按钮
如何禁止access主窗体右上角的退出按钮?
用代码使access主窗体上的“X”失效
在程序开始的窗体里加入:
Private 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 Sub FORM_Load()
Const MF_BYCOMMAND = &H0&
Const SC_CLOSE = &HF060 ''恢复按钮的ID是:&HF120
Dim hMenu As Long
hMenu = GetSystemMenu(Application.hWndaccessApp, 0)
Call DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
End Sub
还有个最简单的办法,不管按钮id,统统关掉
Private Sub closeAll()
Const MF_BYCOMMAND = &H0&
Dim hMenu As Long
hMenu = GetSystemMenu(Application.hWndaccessApp, 0)
dim I as long
for I=-5000 to 0
DeleteMenu hMenu, I, MF_BYCOMMAND
next I
End Sub
(责任编辑:admin)
- ·API函数详细解释
- ·Access从剪切版里复制和粘贴数据
- ·Access利用api实现打开/关闭光驱
- ·应用程序开机自动启动(注册表操作技巧
- ·Access VBA 判断网络是否连通的多种办
- ·什么是ADP,了解ADP的优缺点
- ·优秀产品大全--通用票据打印软件(新)
- ·[技巧分享]多条Shell语句执行导致判断
- ·在access中可以调用API函数GetFileInfo
- ·Access API集中营--增加临时使用的字体
- ·API ShellExecute 功能说明及应用示例
- ·在VB中使用API函数(什么是API? )
- ·API实现完美的图片出现效果(转)
- ·API 设置调整系统当前时间
- ·如何检测以及设置键盘状态
- ·不关闭当前数据库COPY当前数据库