Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

请教下这个窗体的透明度在哪调整

小易  发表于:2011-11-09 09:02:31  
复制

请教下这个窗体的透明度在哪调整?刚接触ACCESS有的实在看不懂。请高手帮忙。。谢谢。点击下载此附件

 

 

 

Top
dbaseIIIer 发表于:2011-11-09 19:15:53
'窗体透明声明
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
你程式里有段代码,请一定要用上面的宣告。 在 Startup() 里呼叫的 If GetDbSetting("TransWindowEffectOn", False) Then SetWindowTrans hWndAccessApp
'==========================================================================================================================
'-函数名称:         SetWindowTrans
'-功能描述:         设置窗口透明
'-输入参数:         hwnd    窗口句柄
'                   Color   要设为透明的颜色,Mode参数为1(或其它非0值)时有效
'                   Alpha   窗口透明度,Mode参数设0时有效
'                   Mode    透明模式
'-返回参数:         返回true表示函数调用成功,否则调用失败
'-使用示例:         SetWindowTrans Me.hwnd
'-相关调用:         apiGetWindowLong(), apiSetWindowLong(), apiSetLayeredWindowAttributes()
'-使用注意:         直接对MDI窗口中的非弹出式子窗口使用无效,将hwnd参数设为MDI父窗口的句柄时,效果作用于父窗口及其所有非弹
'                   出式子窗口
'-兼 容 性:         Windows 2000以上系统
'-参考资料:
'-作    者:         红尘如烟
'-创建日期;         2009-3-10
'==========================================================================================================================
Public Function SetWindowTrans(Hwnd As Long, Optional Color As Long = 0, Optional Alpha As Byte = 230, _
                                Optional Mode As conWindowTransMode = conTransModeAlpha) As Boolean
On Error GoTo Err_SetWindowTrans
    Dim rtn As Long
   
    rtn = GetWindowLong(Hwnd, GWL_EXSTYLE)
    rtn = rtn Or WS_EX_LAYERED
    Call SetWindowLong(Hwnd, GWL_EXSTYLE, rtn)
   
    If Mode = conTransModeAlpha Then
        Mode = LWA_ALPHA
    Else
        Mode = LWA_COLORKEY
    End If
   
    SetWindowTrans = CBool(SetLayeredWindowAttributes(Hwnd, Color, Alpha, Mode))
Exit_SetWindowTrans:
    Exit Function
Err_SetWindowTrans:
    MsgBox Err.Description, vbCritical, "Error of SetWindowTrans()"
    Resume Exit_SetWindowTrans
End Function


小易 发表于:2011-11-11 13:50:32
谢谢..后来我自己认真看了一遍还是看懂了,不过还是得谢谢你.

总记录:2篇  页次:1/1 9 1 :