怎么在vb 玻璃效果
急急急,求代码 半透明效果?看看这个:VB可以模拟Vista的磨砂玻璃效果。 Vista玻璃透明控件VB6源码:
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_ALPHA = &H1
Private Sub Form_Load()
Me.BackColor = vbWhite
Text1.BackColor = vbWhite
Command1.BackColor = vbWhite
Label1.BackColor = vbWhite
Dim rtn As Long
rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, vbWhite, 150, 2 '最后一个参数为 1 时, 是 挖去 第二个参数指定的色,第3个设置透明度的参数无效, 最后一个参数为 2时,第2个参数无效,第3个参数有效 设置透明度范围 【0,255】
End Sub
http://www.codesky.net/showhtml/10406.htm 不是半透明,是磨砂玻璃,不过谢谢了
补充:VB , 多媒体