Membuat Form Transfarant

Mig33Kertasemaya - Silakan kamu bikin project kosong untuk percobaannya dan isi coding nya sebagai berikut

Option Explicit
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, 130, LWA_ALPHA
'130 nilai transparent, semakin kecil semakin transparent. normalnya 255
End Sub

lalu cobalah untuk play (start) jika berhasil maka akan seperti tampilan gambar di atas
Selamat Mencobaaaaaaaaaaaaa..........

Artikel Yang Berhubungan:

Tidak ada komentar:

Informasi Umum - Kumpulan Artikel Bebas Baca © 2009 - Bookmarking