将access环境背景隐藏,使你的软件更加专业,美观
时 间:2010-03-15 00:00:00
作 者:张万里 ID:10085 城市:天津
摘 要:将ACCESS环境背景隐藏,使你的软件更加专业,美观,最近发现这个代码大家对此很感兴趣,特加追加实例一个,谢谢关注!
正 文:
代 码:
'************ 代码开始 **********
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
' 使用举例
' 最大化 Access 窗口
' fSetAccessWindow(SW_SHOWMAXIMIZED)
' 最小化 Access 窗口
' fSetAccessWindow(SW_SHOWMINIMIZED)
' 隐藏 Access 窗口
' fSetAccessWindow(SW_HIDE)
' 正常显示 Access 窗口
' fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loFORM As Form
On Error Resume Next
Set loFORM = Screen.ActiveForm
If Err <> 0 Then ' 没有活动窗体 no ActiveFORM
If nCmdShow = SW_HIDE Then
MsgBox "除非屏幕上有一个窗口,否则不能隐藏 Access 主窗口!" _
& vbCr & vbCr _
& "Cannot hide Access unless " _
& "a FORM is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
If nCmdShow = SW_SHOWMINIMIZED And loFORM.Modal = True Then
MsgBox "不能由屏幕上的 " & (loFORM.Caption + " ") & "窗体最小化 Access 主窗口!" _
& vbCr & vbCr _
& "Cannot minimize Access with " _
& (loFORM.Caption + " ") _
& "FORM on screen"
ElseIf nCmdShow = SW_HIDE And loFORM.PopUp <> True Then
MsgBox "不能由屏幕上的 " & (loFORM.Caption + " ") & "窗体隐藏 Access 主窗口!" _
& vbCr & vbCr _
& "Cannot hide Access with " _
& (loFORM.Caption + " ") _
& "FORM on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
End If
fSetAccessWindow = (loX <> 0)
End Function
'************ 代码结束 **********
--------------------------------------------------------------------
Private Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub Form_Load()
ShowWindow Me.Application.hWndAccessApp, 2
End Sub
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access对子窗体数据进行批...(10.30)
- 最精简的组合框行来源数据快速输...(10.25)
- Access仿平台的多值选择器...(10.24)
- 【Access日期区间段查询】...(10.22)
- 【Access源码示例】VBA...(10.12)
- Access累乘示例,Acce...(10.09)
- 数值8.88,把整数8去掉,转...(10.08)
- 【Access自定义函数】一个...(09.30)
- 【Access选项卡示例】Ac...(09.09)
学习心得
最新文章
- Access快速开发平台--对上传...(11.22)
- Access快速开发平台企业版--...(11.18)
- 不会用多表联合查询,多表查询没结果...(11.16)
- 【案例分享】主键字段值含有不间断空...(11.16)
- Access快速开发平台--后台D...(11.14)
- 微软Access邀测新Monaco...(11.12)
- Access列表框左右互选、列表框...(11.11)
- 高效率在导入数据前删除记录(11.10)
- Access报价单转订单示例代码(11.08)
- Access系统自带的日期选择器不...(11.08)