Assalamu’alaikum para bloggers sejati, udah
lama nih enggak posting masalah pemrograman VB (Visual Basic) itu loh software
untuk membuat aplikasi , untuk kali ini kita akan membuat form di vb menjadi
transparan oke alat alat yang diperlukan
- Visual Basic 6.0
- Memiliki bakat programmer
- Secangkir kopi
Oke yang pertama harus dilakukan adalah Buka
dulu aplikasi VB nya
Setelah dibuka buatlah sebuah module lalu isikan code sebagai berikut dan ganti nama
module tersebut menjadi modForm
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 color As Long, ByVal x As Byte, ByVal alpha As Long) As Boolean
Const LWA_BOTH = 3
Const LWA_ALPHA = 2
Const LWA_COLORKEY = 1
Const GWL_EXSTYLE = -20
Const WS_EX_LAYERED = &H80000
Dim iTransparant As Integer
Sub MakeTransparan(hWndBro As Long, iTransp As Integer)
On Error Resume Next
Dim ret As Long
ret = GetWindowLong(hWndBro, GWL_EXSTYLE)
SetWindowLong hWndBro, GWL_EXSTYLE, ret Or WS_EX_LAYERED
SetLayeredWindowAttributes hWndBro, RGB(255, 255, 0), iTransp, LWA_ALPHA
Exit Sub
End Sub
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 color As Long, ByVal x As Byte, ByVal alpha As Long) As Boolean
Const LWA_BOTH = 3
Const LWA_ALPHA = 2
Const LWA_COLORKEY = 1
Const GWL_EXSTYLE = -20
Const WS_EX_LAYERED = &H80000
Dim iTransparant As Integer
Sub MakeTransparan(hWndBro As Long, iTransp As Integer)
On Error Resume Next
Dim ret As Long
ret = GetWindowLong(hWndBro, GWL_EXSTYLE)
SetWindowLong hWndBro, GWL_EXSTYLE, ret Or WS_EX_LAYERED
SetLayeredWindowAttributes hWndBro, RGB(255, 255, 0), iTransp, LWA_ALPHA
Exit Sub
End Sub
Lalu pada Form Load isikan
Option Explicit Private Sub Form_Load() On Error Resume Next MakeTransparan Me.hWnd, 75 End Sub
Nilai yang berwarna hijau
itu bisa agan rubah menjadi berapapun asalkan jangan sampai melewati angka 255 selain itu code di form load itu bisa agan
rubah menjadi Option Button, Command Button, maupun check box tinggal agan
sendiri yang mengubah code – codenya
Kalau butuh source codenya klik dibawah ini
Rar Password : hamzahfansyuri560.blogspor.com
Oke sampai disini dulu informasi Coding yang
bisa di Share oleh Hamzah
Fansyuri 14™ kalau gagal Coba lagi karena code ini sudah Admin coba dan
BERHASIL dan kalau ada pertanyaan