Sabtu, 10 Desember 2011

Membuat Tampilan Form Visual Basic Menjadi Transparant

Buat Sebuah Form , standart EXE jja ....

teruz masukin coding ni nih




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


Const WS_EX_LAYERED = &H80000
 Const GWL_EXSTYLE = (-20)
 Const LWA_ALPHA = &H2


Private Sub Form_Load()
 Dim rtn As Long
 rtn = GetWindowLong(hwnd, GWL_EXSTYLE)
 rtn = rtn Or WS_EX_LAYERED
 SetWindowLong hwnd, GWL_EXSTYLE, rtn
 SetLayeredWindowAttributes hwnd, 0, 150, LWA_ALPHA 'nilai di tengah setelah 0 adalah nilai transparant semakin kecil nilainya semakin transparant, nilai 255 untuk reset.
 End Sub


Dijamin Tampilannya Bakalan Kaya Gini NIH ...


Tidak ada komentar:

Posting Komentar