Google Translate
Arabic Korean Japanese Chinese Simplified
Russian Portuguese English French
German Spain Italian Dutch
0

[Tutorial] Cara membuat Form Transparan

Sabtu, 15 Oktober 2011
Share this Article on :
Tutor membuat Form transparan seperti gambar berikut:



Posted Image


Bahan:
1. Buat 1 Form
2. Buat 1 Module
3. Buat 1 Timer
4. Buat 3 Label
5. Buat 1 Gambar
Source Code Form1:


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

Private Sub Label1_Click()
End
End Sub

Private Sub Timer1_Timer()
If Label3.Visible = False Then
Label3.Visible = True
Else
Label3.Visible = False
End If
End Sub

Source Code Module1:

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


Artikel Terkait:

No Responses to "[Tutorial] Cara membuat Form Transparan"

Posting Komentar

Kahar Hacker

Visitor My BLog

free counters