Tips kali ini adalah bagaimana Membuat Form Transparant dengan Visual Basic,
disini kita menggunakan Fungsi API yaitu GetWindowLong, SetWindowLong
dan SetLayeredWindowAttributes. Saya rasa tidak perlu penjelasan yang
detail untuk hal ini sobat bisa langsung melihat penampakannya dibawah
iniBagaimana dengan Codingnya ikuti Langkah - Langkah Berikut :
Untuk ketajaman transparant sobat bisa menggati Angka - Angka yang berwarna merah dengan angka yang lain (maximal value 255). Mudah - mudahan ada mamfaatnya selamat mencoba ... salam
- Buat Project Baru Standart Exe
Option Explicit
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
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 crColor As Long, ByVal nAlpha As Byte, ByVal dwFlags As Long) As Long
Private Sub Form_Load()
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(Me.hwnd, RGB(255, 0, 255), 128, LWA_ALPHA Or LWA_COLORKEY)
End Sub
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
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 crColor As Long, ByVal nAlpha As Byte, ByVal dwFlags As Long) As Long
Private Sub Form_Load()
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(Me.hwnd, RGB(255, 0, 255), 128, LWA_ALPHA Or LWA_COLORKEY)
End Sub
Untuk ketajaman transparant sobat bisa menggati Angka - Angka yang berwarna merah dengan angka yang lain (maximal value 255). Mudah - mudahan ada mamfaatnya selamat mencoba ... salam
Tidak ada komentar:
Posting Komentar
If you find any difficulty please comment below .... ^ _ ^