PERHATIAN

Password semua file download:
"softbimantoro"

Kamis, 10 November 2011

[VB 6.0] Form Transparan

Posted by b_agoy 10.19, under | No comments


Ingin membuat form di VB 6.0 menjadi transparan seperti diatas??
Silahkan simak tutorialnya dibawah.

Buat sebuah Module baru lalu ketikkan :
Option Explicit

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
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long


Public Sub FadeForm(ByVal Frm As Form, ByVal Level As Byte)
On Error Resume Next
Dim msg As Long

msg = GetWindowLong(Frm.hwnd, -20) Or &H80000
SetWindowLong Frm.hwnd, -20, msg
SetLayeredWindowAttributes Frm.hwnd, 0, Level, &H2
End Sub

Selanjutnya di bagian Form yang akan dijadikan transparan, di 'Form_Load' ketikkan :
FadeForm Me, 125

Tingkat transparansi dapat diubah dengan mengganti nilai properti level dari 0 sampai 255.


DOWNLOAD PROJECT

0 komentar:

Posting Komentar

Blog Archive

Arsip Blog