设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

隐藏ACCESS主设计窗口

2015-3-14 16:04| 发布者: admin| 查看: 1348| 评论: 6|原作者: 天启|来自: www.office-cn.net

摘要: ACCESS程序编完使用时,能不能隐去ACCESS主窗口,象VB一样,这样也可防止其他人在主窗口改动程序,看起来又美观,要不然程序用起来总有一种未完成的感觉!!!!!!
ACCESS程序编完使用时,隐去ACCESS主窗口,象VB一样,这样也可防止其他人在主窗口改动程序,看起来又美观!!!!
1.建立如下函數 
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long 
Dim dwReturn As Long 

Const SW_HIDE = 0 
Const SW_SHOWNORMAL = 1 
Const SW_SHOWMINIMIZED = 2 
Const SW_SHOWMAXIMIZED = 3 

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _ 
    ByVal nCmdShow As Long) As Long 
    
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean 
If Procedure = "Hide" Then 
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE) 
End If 
If Procedure = "Show" Then 
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED) 
End If 
If Procedure = "Minimize" Then 
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED) 
End If 
If SwitchStatus = True Then 
   If IsWindowVisible(hWndAccessApp) = 1 Then 
       dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE) 
   Else 
       dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED) 
   End If 
End If 
If StatusCheck = True Then 
   If IsWindowVisible(hWndAccessApp) = 0 Then 
       fAccessWindow = False 
   End If 
   If IsWindowVisible(hWndAccessApp) = 1 Then 
       fAccessWindow = True 
   End If 
End If 
End Function 
2.按如下方法調用 
fAccessWindow ("Hide",False, False) 
发表评论

最新评论

引用 gnoy 2002-3-9 19:08
ACCESS97能作到,不知其他版本如何
引用 gnoy 2002-3-9 19:11
1.建立如下函數
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long

Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long
   
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
   dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
   If IsWindowVisible(hWndAccessApp) = 1 Then
       dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
   Else
       dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
   End If
End If
If StatusCheck = True Then
   If IsWindowVisible(hWndAccessApp) = 0 Then
       fAccessWindow = False
   End If
   If IsWindowVisible(hWndAccessApp) = 1 Then
       fAccessWindow = True
   End If
End If
End Function
2.按如下方法調用
fAccessWindow ("Hide",False, False)
引用 天启 2002-3-12 00:53
ACCESS上好象不行
引用 天启 2002-3-12 00:53
ACCESS2000上好象不行
引用 ganrong 2002-3-12 05:25
启动窗体使用弹出方式应该可以吧(看不到ACCESS的窗口了)
引用 chenwintek 2002-3-12 16:59
在ACCESS XP里不行。

查看全部评论(6)

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-3-29 17:41 , Processed in 0.095003 second(s), 23 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部