Always Fast! . Everything Free

Follow US

DMCA.com

Cara Membuat Form VisualBasic Transparant

by Unknown , at 01.21 , have 0 komentar

Berikut adalah cara untuk membuat form jadi transparan.
1. Buat sebuah form.
2. Set Back Color dari Form tersebut (hal ini harus dilakukan untuk suksesi proses transparency ini)
3. Tempatkan sebuah control Image di Form tersebut. Pilih Gambar GIF yang transparan. Dapat dilakukan dengan Adobe Photoshop. Dengan cara Save As -> Compuserv (GIF)
Set Transparency Mode

4. Tambahkan satu modul di project (Add Module)
5. Lakukan Pendeklarasian fungsi2 dari winApi berikut di modul tersebut
Kode :

Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Sub SetTransparency(piHwnd As Long, piColor As OLE_COLOR)
Const G_E = &HFFEC
Const W_E = &H80000
Const LW_KEY = &H1
SetWindowLong piHwnd, G_E, GetWindowLong(piHwnd, G_E) Or W_E
SetLayeredWindowAttributes piHwnd, piColor, 0, LW_KEY
End Sub

6. Di Form yang telah dibuat sebelumnya, tambahkan kode berikut

Private Sub Form_Initialize()
Call SetTransparency(Me.hwnd, Me.BackColor)
End Sub

7. Silahkan Run Project (F5)

 by AlexCucuMbahGoogle
Cara Membuat Form VisualBasic Transparant
Cara Membuat Form VisualBasic Transparant - written by Unknown , published at 01.21 . And have 0 komentar
No comment Add a comment

Anda sopan kami segan

Cancel Reply
GetID
Copyright ©2014 We Blog by
Theme designed by ムしるメ
Powered by Blogger