Tampilan Form yang cantik

akan membuat program kita lebi diminati..
Nah, sekarang kita coba buat
form dengan efek transparant
tampilannya kaya gini nih
berikut ini listing lengkapnya :
Option Explicit
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hWnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
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
Sub bikin_transparan(LhWnd As Long, ByVal bLevel As Byte)
On Error GoTo salah
Dim lOldStyle As Long
If (LhWnd <> 0) Then
lOldStyle = GetWindowLong(LhWnd, (-20))
SetWindowLong LhWnd, (-20), lOldStyle Or &H80000
SetLayeredWindowAttributes LhWnd, 0, bLevel, &H2&
End If
salah:
End Sub
Private Sub Form_Load()
bikin_transparan Me.hWnd, 150
End Sub
Posting Komentar