还是vb控件透明化的问题
发表在VB答疑区
2012-10-30
是否精华
是
否
版块置顶:
是
否
关于这个问题,上次C语言的答复是:
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 Sub Form_Load()
SetWindowLong hwnd, (-20), &H80000
SetLayeredWindowAttributes Me.hwnd, vbBlack, 100, 2
End Sub
我试了下,结果是窗体和该窗体下的所有控件都半透明化了,我要的是只有textbox透明,窗体和其他控件正常显示,那该怎么办?
还有能否简要讲一下SetWindowLong和SetLayeredWindowAttributes的属性参数,尤其是SetWindowLong的。
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 Sub Form_Load()
SetWindowLong hwnd, (-20), &H80000
SetLayeredWindowAttributes Me.hwnd, vbBlack, 100, 2
End Sub
我试了下,结果是窗体和该窗体下的所有控件都半透明化了,我要的是只有textbox透明,窗体和其他控件正常显示,那该怎么办?
还有能否简要讲一下SetWindowLong和SetLayeredWindowAttributes的属性参数,尤其是SetWindowLong的。